idimensionz/linode-api-v4

View on GitHub

Showing 12 of 21 total issues

DomainModel has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class DomainModel
{
    /**
     * @var int|null
     */
Severity: Minor
Found in src/LinodeApiV4/Api/Domains/DomainModel.php - About 3 hrs to fix

    DomainRecordModel has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DomainRecordModel
    {
        const TYPE_A = 'A';
        const TYPE_AAAA = 'AAAA';
        const TYPE_NS = 'NS';
    Severity: Minor
    Found in src/LinodeApiV4/Api/Domains/Records/DomainRecordModel.php - About 2 hrs to fix

      TypeModel has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class TypeModel
      {
          const MEMORY_CLASS_STANDARD = 'standard';
          const MEMORY_CLASS_HIGH = 'highmem';
      
      
      Severity: Minor
      Found in src/LinodeApiV4/Api/Linode/Types/TypeModel.php - About 2 hrs to fix

        File DomainModel.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
         * iDimensionz/{linode-api-v4}
         * DomainModel.php
         *  
        Severity: Minor
        Found in src/LinodeApiV4/Api/Domains/DomainModel.php - About 2 hrs to fix

          Function isValidCondition has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function isValidCondition($condition)
              {
                  $isValidCondition = false;
                  if ($condition instanceof FilterConditionAbstract) {
                      if ($condition instanceof FilterConditionFilter) {
          Severity: Minor
          Found in src/LinodeApiV4/Api/Filters/FilterAbstract.php - About 2 hrs 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 toArray has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function toArray(): array
              {
                  $data = [];
                  $domain = $this->getDomainName();
                  if (!is_null($domain)) {
          Severity: Minor
          Found in src/LinodeApiV4/Api/Domains/DomainModel.php - About 2 hrs to fix

            Method toArray has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function toArray(): array
                {
                    $data = [];
                    $type = $this->getType();
                    if (!is_null($type)) {
            Severity: Minor
            Found in src/LinodeApiV4/Api/Domains/Records/DomainRecordModel.php - About 1 hr to fix

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

                  public function toArray(): array
                  {
                      $data = [];
                      $domain = $this->getDomainName();
                      if (!is_null($domain)) {
              Severity: Minor
              Found in src/LinodeApiV4/Api/Domains/DomainModel.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 isValidCondition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function isValidCondition($condition)
                  {
                      $isValidCondition = false;
                      if ($condition instanceof FilterConditionAbstract) {
                          if ($condition instanceof FilterConditionFilter) {
              Severity: Minor
              Found in src/LinodeApiV4/Api/Filters/FilterAbstract.php - About 1 hr to fix

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

                    public function toArray(): array
                    {
                        $data = [];
                        $type = $this->getType();
                        if (!is_null($type)) {
                Severity: Minor
                Found in src/LinodeApiV4/Api/Domains/Records/DomainRecordModel.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 jsonSerialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function jsonSerialize()
                    {
                        $returnData = [];
                        $conditions = $this->getConditions();
                        $data = [];
                Severity: Minor
                Found in src/LinodeApiV4/Api/Filters/FilterAbstract.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 setValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function setValue($value)
                    {
                        $operatorTypes = $this->getValueOperatorTypes();
                        $key = $this->getField();
                        // Make sure the value is the correct type for this operator.

                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