Skip to content

LoD Violation: Deep Attribute Chaining in Documentation Example #124

@coderabbitai

Description

@coderabbitai

Overview

This is a sub-task of #119 - Refactor: Address Law of Demeter violations for better encapsulation

Priority: Critical (affects contributor understanding)
Pattern: client.tool_client.tool_fuzzer.executor.max_concurrency

Violation Found

Location: docs/development/contributing.md:91

This is a 4-level deep chain that severely violates Law of Demeter and was discussed in PR #116.

Why It's Critical

This example appears in contributor documentation, teaching new contributors an anti-pattern.

Refactoring Suggestion

class MCPFuzzerClient:
    @property
    def executor_max_concurrency(self) -> int:
        return self.tool_client.tool_fuzzer.executor.max_concurrency

Acceptance Criteria

  • Add wrapper method or property to MCPFuzzerClient
  • Update documentation example to use new method/property
  • Add tests for new API
  • Review other documentation for similar violations

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions