klitsche/dog

View on GitHub

Showing 80 of 103 total issues

Function analyze has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function analyze(ElementInterface $element): iterable
    {
        if (
            $element instanceof DocBlockAwareInterface
            && $element->hasDocBlock() === true
Severity: Minor
Found in src/Analyzer/Rules/DocBlockLinkDescriptionRule.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function analyze has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function analyze(ElementInterface $element): iterable
    {
        if (
            $element instanceof DocBlockAwareInterface
            && $element->hasDocBlock() === true
Severity: Minor
Found in src/Analyzer/Rules/DocBlockVersionVersionRule.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function analyze has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function analyze(ElementInterface $element): iterable
    {
        if (
            $element instanceof DocBlockAwareInterface
            && $element->hasDocBlock() === true
Severity: Minor
Found in src/Analyzer/Rules/DocBlockSinceVersionRule.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function analyze has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function analyze(ElementInterface $element): iterable
    {
        if ($element instanceof DocBlockAwareInterface
            && $element->hasDocBlock() === true
            && $element->getDocBlock()->hasTag('param') === true
Severity: Minor
Found in src/Analyzer/Rules/DocBlockParamDescriptionRule.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $level,
        ElementInterface $element,
        string $message,
        int $lineNumber,
        RuleInterface $rule
Severity: Minor
Found in src/Analyzer/Issue.php - About 35 mins to fix

    Function findParamTag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function findParamTag(Php\Argument $argument): ?DocBlock\Tags\Param
        {
            if ($this->getDocBlock() === null) {
                return null;
            }
    Severity: Minor
    Found in src/Elements/Method.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze(ElementInterface $element): iterable
        {
            if (
                $element instanceof DocBlockAwareInterface
                && $element->hasDocBlock() === true
    Severity: Minor
    Found in src/Analyzer/Rules/DocBlockInvalidTagRule.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze(ElementInterface $element): iterable
        {
            if (
                ($element instanceof Function_) === false
                && ($element instanceof Method) === false
    Severity: Minor
    Found in src/Analyzer/Rules/DocBlockReturnAllowedRule.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function output has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function output(): void
        {
            if (
                ($this->summaryByLevel[Issue::ERROR] > 0)
                || (
    Severity: Minor
    Found in src/Cli/IssuesReporter.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze(ElementInterface $element): iterable
        {
            if (
                ($element instanceof Method) === false
                && ($element instanceof Function_) === false
    Severity: Minor
    Found in src/Analyzer/Rules/DocBlockParamAllowedRule.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze(ElementInterface $element): iterable
        {
            if (
                ($element instanceof Class_) === false
                && ($element instanceof Trait_) === false
    Severity: Minor
    Found in src/Analyzer/Rules/DocBlockPropertyAllowedRule.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyze has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze(ElementInterface $element): iterable
        {
            if (
                ($element instanceof Class_) === false
                && ($element instanceof Interface_) === false
    Severity: Minor
    Found in src/Analyzer/Rules/DocBlockMethodAllowedRule.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function functionLink has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function functionLink(?ElementInterface $element): string
        {
            if ($element === null) {
                return '';
            }
    Severity: Minor
    Found in src/Printer/Markdown/Printer.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function findParamTagByArgument has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private function findParamTagByArgument(Php\Argument $argument): ?DocBlock\Tags\Param
        {
            if ($this->php->getDocBlock() === null) {
                return null;
            }
    Severity: Minor
    Found in src/Elements/Function_.php - About 35 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid too many return statements within this method.
    Open

            return null;
    Severity: Major
    Found in src/Elements/Method.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return 'index.md';
      Severity: Major
      Found in src/Printer/Markdown/Printer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return (string) $element->getFqsen();
        Severity: Major
        Found in src/Printer/Markdown/Printer.php - About 30 mins to fix

          Function getType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getType(): ?Type
              {
                  if ($this->getDocBlock() && $this->getDocBlock()->hasTag('var')) {
                      /** @var DocBlock\Tags\Var_ $tag */
                      $tag = $this->getDocBlock()->getTagsByName('var')[0];
          Severity: Minor
          Found in src/Elements/Property.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function enrichInterface has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private function enrichInterface(Interface_ $dataHolder): void
              {
                  $extendedBy = [];
                  $project = $dataHolder->getProject();
          
          
          Severity: Minor
          Found in src/Enrichers/ExtendedBy/ExtendedByEnricher.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function fileName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function fileName(ElementInterface $element): string
              {
                  switch (true) {
                      case $element instanceof Class_:
                      case $element instanceof Interface_:
          Severity: Minor
          Found in src/Printer/Markdown/Printer.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language