kamilsk/Common

View on GitHub

Showing 7 of 7 total issues

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

final class Locator implements \ArrayAccess, \Countable, \Iterator
{
    /** @var string */
    private $defaultChannel;
    /** @var ComponentFactory */
Severity: Minor
Found in src/Monolog/Service/Locator.php - About 2 hrs to fix

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

        public function end(...$args)
        {
            try {
                return ($this->wrapped)(...$args);
            } catch (\Throwable $e) {
    Severity: Minor
    Found in src/Util/Call.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 merge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function merge(array ...$args): array
        {
            \assert('count($args) > 0');
            $res = array_shift($args);
            foreach ($args as $next) {
    Severity: Minor
    Found in src/Util/ArrayHelper.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

    Method softParse has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $xml,
            string $className = null,
            int $options = null,
            string $ns = null,
            bool $isPrefix = null
    Severity: Minor
    Found in src/Util/Xml.php - About 35 mins to fix

      Method parse has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $xml,
              string $className = null,
              int $options = null,
              string $ns = null,
              bool $isPrefix = null
      Severity: Minor
      Found in src/Util/Xml.php - About 35 mins to fix

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

            final protected function getFilteredClasses(): \Generator
            {
                foreach ($this->getClasses() as $class) {
                    if (!$this->isFiltered($class)) {
                        $signal = yield $class;
        Severity: Minor
        Found in src/Test/ClassAvailability.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 findByPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function findByPath(string $path, array $scope)
            {
                if (mb_strpos($path, ':')) {
                    foreach (explode(':', $path) as $i => $key) {
                        if (!isset($scope[$key])) {
        Severity: Minor
        Found in src/Util/ArrayHelper.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