mrcnpdlk/teryt-api

View on GitHub

Showing 52 of 52 total issues

File NativeApi.php has 674 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);
/**
 * TERYT-API
Severity: Major
Found in src/NativeApi.php - About 1 day to fix

    NativeApi has 56 functions (exceeds 20 allowed). Consider refactoring.
    Open

    final class NativeApi
    {
        /**
         * @var string Wyszukiwanie wśród wszystkich rodzajów jednostek
         */
    Severity: Major
    Found in src/NativeApi.php - About 1 day to fix

      The class NativeApi has 55 non-getter- and setter-methods. Consider refactoring NativeApi to keep number of methods under 25.
      Open

      final class NativeApi
      {
          /**
           * @var string Wyszukiwanie wśród wszystkich rodzajów jednostek
           */
      Severity: Minor
      Found in src/NativeApi.php by phpmd

      TooManyMethods

      Since: 0.1

      A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      The default was changed from 10 to 25 in PHPMD 2.3.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanymethods

      The class NativeApi has an overall complexity of 91 which is very high. The configured complexity threshold is 50.
      Open

      final class NativeApi
      {
          /**
           * @var string Wyszukiwanie wśród wszystkich rodzajów jednostek
           */
      Severity: Minor
      Found in src/NativeApi.php by phpmd

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianyUlicAdresowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianyUlicAdresowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianySimcStatystyczny(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianySimcStatystyczny',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianyNTS(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianyNTS',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianyTercUrzedowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianyTercUrzedowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianyUlicUrzedowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianyUlicUrzedowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianySimcAdresowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianySimcAdresowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianyTercAdresowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianyTercAdresowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 818..832
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public function PobierzZmianySimcUrzedowy(DateTime $fromDate, DateTime $toDate = null): SplFileObject
          {
              $toDate  = $toDate ?? new DateTime();
              $res     = $this->oConfig->request(
                  'PobierzZmianySimcUrzedowy',
      Severity: Major
      Found in src/NativeApi.php and 7 other locations - About 3 hrs to fix
      src/NativeApi.php on lines 731..745
      src/NativeApi.php on lines 760..774
      src/NativeApi.php on lines 789..803
      src/NativeApi.php on lines 847..861
      src/NativeApi.php on lines 876..890
      src/NativeApi.php on lines 905..919
      src/NativeApi.php on lines 934..948

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function WyszukajUliceWRejestrze(
              string $name = null,
              string $identityName = 'ul.',
              string $streetId = null,
              array $tSimc = [],
      Severity: Major
      Found in src/NativeApi.php and 1 other location - About 2 hrs to fix
      src/NativeApi.php on lines 1345..1372

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 133.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function WyszukajMiejscowoscWRejestrze(
              string $name = null,
              string $cityId = null,
              array $tSimc = [],
              array $tTerc = [],
      Severity: Major
      Found in src/NativeApi.php and 1 other location - About 2 hrs to fix
      src/NativeApi.php on lines 1416..1443

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 133.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function WeryfikujNazwaAdresUlic(
              string $provinceName,
              string $districtName,
              string $communeName,
              string $cityName,
      Severity: Major
      Found in src/NativeApi.php and 1 other location - About 2 hrs to fix
      src/NativeApi.php on lines 1176..1202

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 132.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function WeryfikujNazwaAdresUlicAdresowy(
              string $provinceName,
              string $districtName,
              string $communeName,
              string $cityName,
      Severity: Major
      Found in src/NativeApi.php and 1 other location - About 2 hrs to fix
      src/NativeApi.php on lines 1132..1158

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 132.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function WeryfikujAdresWmiejscowosciAdresowy(
              string $provinceName,
              string $districtName,
              string $communeName,
              string $cityName,
      Severity: Major
      Found in src/NativeApi.php and 2 other locations - About 1 hr to fix
      src/NativeApi.php on lines 1050..1071
      src/NativeApi.php on lines 1305..1329

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function WeryfikujAdresWmiejscowosci(
              string $provinceName,
              string $districtName,
              string $communeName,
              string $cityName,
      Severity: Major
      Found in src/NativeApi.php and 2 other locations - About 1 hr to fix
      src/NativeApi.php on lines 1091..1112
      src/NativeApi.php on lines 1305..1329

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          public function WyszukajMiejscowoscWJPT(
              string $provinceName,
              string $districtName,
              string $communeName,
              string $cityName,
      Severity: Major
      Found in src/NativeApi.php and 2 other locations - About 1 hr to fix
      src/NativeApi.php on lines 1050..1071
      src/NativeApi.php on lines 1091..1112

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 116.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function find has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public function find(string $id)
          {
              switch (strlen($id)) {
                  case 6:
                      $provinceId = substr($id, 0, 2);
      Severity: Minor
      Found in src/Model/Commune.php - About 1 hr 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