codeclimate/php-test-reporter

View on GitHub

Showing 12 of 19 total issues

Method sendWithCurl has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function sendWithCurl($url, $payload)
    {
        $response = new \stdClass;
        $curl     = curl_init($url);
        curl_setopt($curl, CURLOPT_HEADER, true);
Severity: Minor
Found in src/TestReporter/ApiClient.php - About 1 hr to fix

    Method infoFrom has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function infoFrom(array $server)
        {
            if (isset($server["TRAVIS"])) {
                return $this->travisProperties($server);
            }
    Severity: Minor
    Found in src/TestReporter/Entity/CiInfo.php - About 1 hr to fix

      Method send has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function send(Entity\JsonFile $json)
          {
              $response = new \stdClass;
              $payload  = (string)$json;
              $options  = array(
      Severity: Minor
      Found in src/TestReporter/ApiClient.php - About 1 hr to fix

        Function infoFrom has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function infoFrom(array $server)
            {
                if (isset($server["TRAVIS"])) {
                    return $this->travisProperties($server);
                }
        Severity: Minor
        Found in src/TestReporter/Entity/CiInfo.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 execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $logger  = new ConsoleLogger($output);
                $updater = new Updater(null, false, Updater::STRATEGY_GITHUB);
        
        
        Severity: Minor
        Found in src/ConsoleCommands/SelfUpdateCommand.php - About 1 hr to fix

          Avoid too many return statements within this method.
          Open

                      return $this->buildkiteProperties($server);
          Severity: Major
          Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $this->werckerProperties($server);
            Severity: Major
            Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->gitlabCiProperties($server);
              Severity: Major
              Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->codeshipProperties($server);
                Severity: Major
                Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return array();
                  Severity: Major
                  Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $this->tddiumProperties($server);
                    Severity: Major
                    Found in src/TestReporter/Entity/CiInfo.php - About 30 mins to fix

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

                          protected function execute(InputInterface $input, OutputInterface $output)
                          {
                              $logger  = new ConsoleLogger($output);
                              $updater = new Updater(null, false, Updater::STRATEGY_GITHUB);
                      
                      
                      Severity: Minor
                      Found in src/ConsoleCommands/SelfUpdateCommand.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