stellar-php/stellar

View on GitHub

Showing 15 of 17 total issues

Request has 42 functions (exceeds 20 allowed). Consider refactoring.
Open

class Request implements RequestInterface, OptionableInterface, StringableInterface
{
    use StringableTrait;

    /** @var string */
Severity: Minor
Found in src/Curl/Request/Request.php - About 5 hrs to fix

    MultiRequest has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MultiRequest implements RequestInterface
    {
        /** @var resource */
        protected $_resource;
    
    
    Severity: Minor
    Found in src/Curl/Request/MultiRequest.php - About 2 hrs to fix

      Method withMethod has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function withMethod(string $method) : self
          {
              $this->_method = $method;
      
              unset(
      Severity: Minor
      Found in src/Curl/Request/Request.php - About 1 hr to fix

        Method details has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function details($var) : string
            {
                $result = self::get($var);
                $format = '%s';
                $args = [ $result ];
        Severity: Minor
        Found in src/Common/Type.php - About 1 hr to fix

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

              public static function details($var) : string
              {
                  $result = self::get($var);
                  $format = '%s';
                  $args = [ $result ];
          Severity: Minor
          Found in src/Common/Type.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

          Function flattenKeys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function flattenKeys(array $array, string $glue = '.', ?int $depth = null, string $prefix = '')
              {
                  if ('' !== $prefix && !StringUtil::endsWith($prefix, $glue)) {
                      $prefix .= $glue;
                  }
          Severity: Minor
          Found in src/Common/ArrayUtil.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 withMethod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function withMethod(string $method) : self
              {
                  $this->_method = $method;
          
                  unset(
          Severity: Minor
          Found in src/Curl/Request/Request.php - About 35 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 callable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function callable(callable $callable) : ?string
              {
                  $result = null;
                  switch (true) {
                      case ($callable instanceof \Closure):
          Severity: Minor
          Found in src/Common/Identify.php - About 35 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 request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function request(string $id, callable $callback, array $params = [])
              {
                  if (!$this->has($id)) {
                      $createdService = $callback(...$params);
          
          
          Severity: Minor
          Found in src/Container/Container.php - About 35 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 joinFormat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function joinFormat(string $format, iterable $iterator, bool $exclEmpty = true) : array
              {
                  $formatHasKey = (false !== \strpos($format, '%k'));
                  $formatHasIndex = (false !== \strpos($format, '%i'));
                  $formatHasValue = (false !== \strpos($format, '%v'));
          Severity: Minor
          Found in src/Common/ArrayUtil.php - About 35 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 unset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public function unset(...$idOrService) : array
              {
                  $result = [];
                  foreach ($idOrService as $param) {
                      $id = false;
          Severity: Minor
          Found in src/Container/BasicContainer.php - About 35 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 _filterOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _filterOptions(array $options) : array
              {
                  $constants = Curl::infoConstants();
          
                  $result = [];
          Severity: Minor
          Found in src/Curl/Info.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

          Function execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function execute() : self
              {
                  $this->init();
                  $this->_queueTotal = \count($this->_queue);
                  $this->_queueLeft = $this->_queueTotal;
          Severity: Minor
          Found in src/Curl/Request/MultiRequest.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

          Function flatten has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function flatten(array $array, ?int $depth = null)
              {
                  if (0 === $depth) {
                      return \array_values($array);
                  }
          Severity: Minor
          Found in src/Common/ArrayUtil.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

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

              public function __construct(string $ownerClass, array $customValues = [])
              {
                  parent::__construct($ownerClass);
          
                  $this->_hasCustomValues = !empty($customValues);
          Severity: Minor
          Found in src/Enum/EnumerablesList.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

          Severity
          Category
          Status
          Source
          Language