mrcnpdlk/mojepanstwo-api

View on GitHub

Showing 9 of 27 total issues

Function __construct has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(\stdClass $oData = null, \stdClass $oLayers = null)
    {
        parent::__construct($oData);
        if ($oData) {
            $this->id                        = $this->convertToId($this->id);
Severity: Minor
Found in src/mrcnpdlk/MojePanstwo/Model/KrsEntity.php - About 1 day 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 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(\stdClass $oData = null, \stdClass $oLayers = null)
    {
        parent::__construct($oData);
        if ($oData) {
            $this->id                        = $this->convertToId($this->id);
Severity: Major
Found in src/mrcnpdlk/MojePanstwo/Model/KrsEntity.php - About 3 hrs to fix

    Function __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct(string $nts = null)
        {
            if (null === $nts || \strlen($nts) < 10) {
                Api::getInstance()
                   ->getClient()
    Severity: Minor
    Found in src/mrcnpdlk/MojePanstwo/Model/Address/Nts.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

    Method getKrsEntity has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getKrsEntity($krs, int $pullFlag = KrsEntity::PULL_NONE): KrsEntity
        {
            $krs = (int)$krs;
            $qb  = QueryBuilder::create(KrsEntity::class)
                               ->addLayer('jedynyAkcjonariusz')
    Severity: Minor
    Found in src/mrcnpdlk/MojePanstwo/Api.php - About 1 hr to fix

      Method __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct(string $nts = null)
          {
              if (null === $nts || \strlen($nts) < 10) {
                  Api::getInstance()
                     ->getClient()
      Severity: Minor
      Found in src/mrcnpdlk/MojePanstwo/Model/Address/Nts.php - About 1 hr to fix

        Method get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function get(): SearchResponse
            {
        
                $res    = Api::getInstance()
                             ->getClient()
        Severity: Minor
        Found in src/mrcnpdlk/MojePanstwo/QueryBuilder.php - About 1 hr to fix

          Function __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct(\stdClass $oData = null, \stdClass $oLayers = null)
              {
                  if (null !== $oData) {
                      foreach ($oData as $key => $value) {
                          $key = $this->stripProperty($key);
          Severity: Minor
          Found in src/mrcnpdlk/MojePanstwo/Model/ModelAbstract.php - About 55 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 getKrsEntity has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getKrsEntity($krs, int $pullFlag = KrsEntity::PULL_NONE): KrsEntity
              {
                  $krs = (int)$krs;
                  $qb  = QueryBuilder::create(KrsEntity::class)
                                     ->addLayer('jedynyAkcjonariusz')
          Severity: Minor
          Found in src/mrcnpdlk/MojePanstwo/Api.php - About 55 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

              public function __construct(string $self = null, string $first = null, string $next = null, string $last = null, string $prev = null)
          Severity: Minor
          Found in src/mrcnpdlk/MojePanstwo/Model/SearchResponseLinks.php - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language