grgk/seo-analyzer

View on GitHub
src/Page.php

Summary

Maintainability
B
4 hrs
Test Coverage

File Page.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SeoAnalyzer;

use SeoAnalyzer\HttpClient\Client;
Severity: Minor
Found in src/Page.php - About 2 hrs to fix

    Method setUpContentKeywordFactors has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setUpContentKeywordFactors(string $keyword)
        {
            $this->setFactors([
                Factor::KEYWORD_URL => [
                    self::TEXT => $this->getFactor(Factor::URL_PARSED_HOST),
    Severity: Minor
    Found in src/Page.php - About 1 hr to fix

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

          public function setUpMetrics(array $config = [])
          {
              $metrics = [];
              foreach ($config as $factor) {
                  $metric = $factor;
      Severity: Minor
      Found in src/Page.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

      There are no issues that match your filters.

      Category
      Status