phpoxford/spires

View on GitHub

Showing 6 of 6 total issues

Container has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class Container implements ArrayAccess, ContainerContract
{
    /**
     * The current globally available container (if any).
     *
Severity: Minor
Found in src/Container/Container.php - About 3 hrs to fix

    Method parse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parse(string $raw): array
        {
            // =  %x0D %x0A   ; "carriage return" "linefeed"
            $crlf = '\r\n';
    
    
    Severity: Minor
    Found in src/Irc/Parser.php - About 1 hr to fix

      Function dispatch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function dispatch($message)
          {
              $this->debug('━ Dispatching: [' . get_class($message) . ']');
              $this->core->instance(get_class($message), $message);
              $this->indent++;
      Severity: Minor
      Found in src/Core/Dispatcher.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 build has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function build($concrete, array $parameters = [])
          {
              // If the concrete type is actually a Closure, we will just execute it and
              // hand back the results of the functions, which allows functions to be
              // used as resolvers for more fine-tuned resolution of these objects.
      Severity: Minor
      Found in src/Container/Container.php - About 1 hr to fix

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                string $nickname,
                string $username,
                string $hostname,
                string $serverName,
                string $command,
        Severity: Minor
        Found in src/Irc/Message/Inbound/RawMessage.php - About 45 mins to fix

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

              public function build($concrete, array $parameters = [])
              {
                  // If the concrete type is actually a Closure, we will just execute it and
                  // hand back the results of the functions, which allows functions to be
                  // used as resolvers for more fine-tuned resolution of these objects.
          Severity: Minor
          Found in src/Container/Container.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