comsave/soap-client

View on GitHub
src/Phpforce/SoapClient/Client.php

Summary

Maintainability
D
2 days
Test Coverage

File Client.php has 401 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Phpforce\SoapClient;

use Phpforce\Common\AbstractHasDispatcher;
Severity: Minor
Found in src/Phpforce/SoapClient/Client.php - About 5 hrs to fix

    Client has 41 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Client extends AbstractHasDispatcher implements ClientInterface
    {
        /*
         * SOAP namespace
         *
    Severity: Minor
    Found in src/Phpforce/SoapClient/Client.php - About 5 hrs to fix

      Function createSObject has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function createSObject($object, $objectType)
          {
              $sObject = new \stdClass();
      
              foreach (get_object_vars($object) as $field => $value) {
      Severity: Minor
      Found in src/Phpforce/SoapClient/Client.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 createSObject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function createSObject($object, $objectType)
          {
              $sObject = new \stdClass();
      
              foreach (get_object_vars($object) as $field => $value) {
      Severity: Minor
      Found in src/Phpforce/SoapClient/Client.php - About 1 hr to fix

        Function merge has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function merge(array $mergeRequests, $type)
            {
                foreach ($mergeRequests as $mergeRequest) {
                    if (!($mergeRequest instanceof Request\MergeRequest)) {
                        throw new \InvalidArgumentException(
        Severity: Minor
        Found in src/Phpforce/SoapClient/Client.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 merge has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function merge(array $mergeRequests, $type)
            {
                foreach ($mergeRequests as $mergeRequest) {
                    if (!($mergeRequest instanceof Request\MergeRequest)) {
                        throw new \InvalidArgumentException(
        Severity: Minor
        Found in src/Phpforce/SoapClient/Client.php - About 1 hr to fix

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

              protected function checkResult(array $results, array $params)
              {
                  $exceptions = new Exception\SaveException();
          
                  for ($i = 0; $i < count($results); $i++) {
          Severity: Minor
          Found in src/Phpforce/SoapClient/Client.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 call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function call($method, array $params = array())
              {
                  $this->init();
          
                  // Prepare headers
          Severity: Minor
          Found in src/Phpforce/SoapClient/Client.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 createSoapVars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function createSoapVars(array $objects, $type)
              {
                  $soapVars = array();
          
                  foreach ($objects as $object) {
          Severity: Minor
          Found in src/Phpforce/SoapClient/Client.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