Aerendir/console-styles-bundle

View on GitHub

Showing 16 of 34 total issues

SerendipityHQStyleSF4 has 51 functions (exceeds 20 allowed). Consider refactoring.
Open

class SerendipityHQStyleSF4 extends OutputStyle
{
    /**
     * @var int
     */
Severity: Major
Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 7 hrs to fix

    SerendipityHQStyleSF5 has 50 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SerendipityHQStyleSF5 extends OutputStyle
    {
        /** @var int */
        private const MAX_LINE_LENGTH = 120;
    
    
    Severity: Minor
    Found in src/Console/Style/SerendipityHQStyleSF5.php - About 7 hrs to fix

      File SerendipityHQStyleSF4.php has 412 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
       * This file is part of the Serendipity HQ Console Styles Component.
       *
      Severity: Minor
      Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 5 hrs to fix

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

        <?php
        
        /*
         * This file is part of the Serendipity HQ Console Styles Component.
         *
        Severity: Minor
        Found in src/Console/Style/SerendipityHQStyleSF5.php - About 5 hrs to fix

          Method execute has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output): int
              {
                  $outputFormatter = new SerendipityHQOutputFormatter(true);
                  $ioWriter        = new SerendipityHQStyle($input, $output);
                  $ioWriter->setFormatter($outputFormatter);
          Severity: Major
          Found in src/Command/SerendipityHQStylesCommand.php - About 2 hrs to fix

            Function createBlock has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function createBlock($messages, $type = null, $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
                {
                    $indentLength = 0;
                    $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
                    $lines        = [];
            Severity: Minor
            Found in src/Console/Style/SerendipityHQStyleSF5.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 createBlock has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
                {
                    $indentLength = 0;
                    $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
                    $lines        = [];
            Severity: Minor
            Found in src/Console/Style/SF4/SerendipityHQStyleSF4.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 createBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function createBlock($messages, $type = null, $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
                {
                    $indentLength = 0;
                    $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
                    $lines        = [];
            Severity: Minor
            Found in src/Console/Style/SerendipityHQStyleSF5.php - About 1 hr to fix

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

                  protected function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
                  {
                      $indentLength = 0;
                      $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
                      $lines        = [];
              Severity: Minor
              Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 1 hr to fix

                Method execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function execute(InputInterface $input, OutputInterface $output): int
                    {
                        $ioWriter = new SymfonyStyle($input, $output);
                
                        if ($input->getOption('show-ansi')) {
                Severity: Minor
                Found in src/Command/SymfonyStylesCommand.php - About 1 hr to fix

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

                      protected function createBlock($messages, $type = null, $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
                  Severity: Minor
                  Found in src/Console/Style/SerendipityHQStyleSF5.php - About 45 mins to fix

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

                        protected function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
                    Severity: Minor
                    Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 45 mins to fix

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

                          protected function createLine(string $message, $type = null, $style = null, string $prefix = '', bool $escape = false): string
                      Severity: Minor
                      Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 35 mins to fix

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

                            public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false)
                        Severity: Minor
                        Found in src/Console/Style/SF4/SerendipityHQStyleSF4.php - About 35 mins to fix

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

                              protected function createLine(string $message, $type = null, $style = null, string $prefix = '', bool $escape = false): string
                          Severity: Minor
                          Found in src/Console/Style/SerendipityHQStyleSF5.php - About 35 mins to fix

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

                                public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false): void
                            Severity: Minor
                            Found in src/Console/Style/SerendipityHQStyleSF5.php - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language