phug-php/dev-tool

View on GitHub

Showing 7 of 121 total issues

Method configure has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configure()
    {
        $this->setName('check')
            ->addOption(
                'report',
Severity: Major
Found in src/Phug/DevTool/Command/CheckCommand.php - About 2 hrs to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $helper = $this->getHelper('question');
            $args = [
                '--standard'   => $this->getApplication()->getConfigFilePath('phpcs.xml'),
    Severity: Minor
    Found in src/Phug/DevTool/Command/CodeStyleCheckCommand.php - About 1 hr to fix

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $app = $this->getApplication();
              $coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
      
      
      Severity: Minor
      Found in src/Phug/DevTool/Command/CheckCommand.php - About 1 hr to fix

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

            protected function runCoverage(InputInterface $input, OutputInterface $output, $coverageFilePath)
            {
                $app = $this->getApplication();
        
                $phpVersion = $input->getOption('coverage-php-version');
        Severity: Minor
        Found in src/Phug/DevTool/Command/CheckCommand.php - About 1 hr to fix

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

              protected function execute(InputInterface $input, OutputInterface $output)
              {
                  $app = $this->getApplication();
                  $coverageFilePath = $app->getWorkingDirectory().'/coverage.xml';
          
          
          Severity: Minor
          Found in src/Phug/DevTool/Command/CheckCommand.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output)
              {
                  $helper = $this->getHelper('question');
                  $args = [
                      '--standard'   => $this->getApplication()->getConfigFilePath('phpcs.xml'),
          Severity: Minor
          Found in src/Phug/DevTool/Command/CodeStyleCheckCommand.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

          Avoid too many return statements within this method.
          Open

                  return $code;
          Severity: Major
          Found in src/Phug/DevTool/Command/CodeStyleCheckCommand.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language