davispeixoto/Force.com-Toolkit-for-PHP

View on GitHub
src/Davispeixoto/ForceDotComToolkitForPhp/SObject.php

Summary

Maintainability
F
3 days
Test Coverage

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

    public function __construct($response = null)
    {
        if (!isset($response) && !$response) {
            return;
        }
Severity: Minor
Found in src/Davispeixoto/ForceDotComToolkitForPhp/SObject.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

Function xml2array has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function xml2array($contents, $get_attributes = 1)
    {
        if (!$contents) {
            return array();
        }
Severity: Minor
Found in src/Davispeixoto/ForceDotComToolkitForPhp/SObject.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 xml2array has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function xml2array($contents, $get_attributes = 1)
    {
        if (!$contents) {
            return array();
        }
Severity: Major
Found in src/Davispeixoto/ForceDotComToolkitForPhp/SObject.php - About 3 hrs to fix

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

        public function __construct($response = null)
        {
            if (!isset($response) && !$response) {
                return;
            }
    Severity: Major
    Found in src/Davispeixoto/ForceDotComToolkitForPhp/SObject.php - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                          if ((is_array($current[$tag]) && $get_attributes == 0)//If it is already an array...
                              || (isset($current[$tag][0]) && is_array($current[$tag][0]) && ($get_attributes == 1 || $get_attributes == 2))
                          ) {
                              array_push($current[$tag], $result); // ...push the new element into that array.
                          } else { //If it is not an array...
      Severity: Major
      Found in src/Davispeixoto/ForceDotComToolkitForPhp/SObject.php - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status