Bee-Lab/bowerphp

View on GitHub

Showing 36 of 36 total issues

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

        ConfigInterface $config,
        Filesystem $filesystem,
        Client $githubClient,
        RepositoryInterface $repository,
        BowerphpConsoleOutput $output
Severity: Minor
Found in src/Bowerphp/Bowerphp.php - About 35 mins to fix

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

        public function __construct($name, $requiredVersion = null, $version = null, $requires = [], $info = [])
    Severity: Minor
    Found in src/Bowerphp/Package/Package.php - About 35 mins to fix

      Function stripWhitespace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function stripWhitespace($source)
          {
              if (!function_exists('token_get_all')) {
                  return $source;
              }
      Severity: Minor
      Found in src/Bowerphp/Compiler.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 getInstalled has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getInstalled(Finder $finder)
          {
              $packages = [];
              if (!$this->filesystem->exists($this->config->getInstallDir())) {
                  return $packages;
      Severity: Minor
      Found in src/Bowerphp/Installer/Installer.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $this->setGithubToken($output);
      
              $packageName = $input->getArgument('package');
      Severity: Minor
      Found in src/Bowerphp/Command/InfoCommand.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 false;
      Severity: Major
      Found in src/Bowerphp/Installer/Installer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return true;
        Severity: Major
        Found in src/Bowerphp/Installer/Installer.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return true;
          Severity: Major
          Found in src/Bowerphp/Installer/Installer.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $this->tag['name'];
            Severity: Major
            Found in src/Bowerphp/Repository/GithubRepository.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return false;
              Severity: Major
              Found in src/Bowerphp/Bowerphp.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return false;
                Severity: Major
                Found in src/Bowerphp/Bowerphp.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return true;
                  Severity: Major
                  Found in src/Bowerphp/Installer/Installer.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return true;
                    Severity: Major
                    Found in src/Bowerphp/Installer/Installer.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in src/Bowerphp/Bowerphp.php - About 30 mins to fix

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

                            public function installDependencies(InstallerInterface $installer)
                            {
                                $decode = $this->config->getBowerFileContent();
                                if (!empty($decode['dependencies'])) {
                                    foreach ($decode['dependencies'] as $name => $requiredVersion) {
                        Severity: Minor
                        Found in src/Bowerphp/Bowerphp.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 symfonyDoRun has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function symfonyDoRun(InputInterface $input, OutputInterface $output, $default = 'list-commands')
                            {
                                if (true === $input->hasParameterOption(['--version', '-V'])) {
                                    $output->writeln($this->getLongVersion());
                        
                        
                        Severity: Minor
                        Found in src/Bowerphp/Console/Application.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