jfx/ci-report

View on GitHub

Showing 29 of 80 total issues

Method load has 320 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load(ObjectManager $manager)
    {
        $ref1Date = new DateTime();
        $ref1Date->setDate(2017, 7, 1)->setTime(12, 30, 1);
        $ref2Date = new DateTime();
Severity: Major
Found in src/DataFixtures/ORM/Suites.php - About 1 day to fix

    Method load has 256 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function load(ObjectManager $manager)
        {
            $ref1Date = new DateTime();
            $ref1Date->setDate(2017, 7, 1)->setTime(12, 30, 1);
            $ref2Date = new DateTime();
    Severity: Major
    Found in src/DataFixtures/ORM/Campaigns.php - About 1 day to fix

      Method load has 244 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function load(ObjectManager $manager)
          {
              $systemOut = <<<'EOT'
      System out message :
        - Out 1
      Severity: Major
      Found in src/DataFixtures/ORM/Tests.php - About 1 day to fix

        Suite has 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Suite
        {
            const DEFAULT_NAME = 'DEFAULT_SUITE_NAME';
        
            /**
        Severity: Minor
        Found in src/Entity/Suite.php - About 4 hrs to fix

          Test has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Test
          {
              const DEFAULT_NAME = 'DEFAULT_NAME';
              const DEFAULT_CLASSNAME = 'DEFAULT_CLASSNAME';
              const DEFAULT_PACKAGE = '_ROOT_';
          Severity: Minor
          Found in src/Entity/Test.php - About 4 hrs to fix

            File Suites.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Copyright (c) 2017 Francois-Xavier Soubirou.
             *
             * This file is part of ci-report.
            Severity: Minor
            Found in src/DataFixtures/ORM/Suites.php - About 4 hrs to fix

              File Tests.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Copyright (c) 2017 Francois-Xavier Soubirou.
               *
               * This file is part of ci-report.
              Severity: Minor
              Found in src/DataFixtures/ORM/Tests.php - About 3 hrs to fix

                Campaign has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Campaign
                {
                    /**
                     * @var int
                     *
                Severity: Minor
                Found in src/Entity/Campaign.php - About 3 hrs to fix

                  File Campaigns.php has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Copyright (c) 2017 Francois-Xavier Soubirou.
                   *
                   * This file is part of ci-report.
                  Severity: Minor
                  Found in src/DataFixtures/ORM/Campaigns.php - About 2 hrs to fix

                    Method load has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function load(ObjectManager $manager)
                        {
                            $utilService = new UtilService();
                    
                            $dataArray = array(
                    Severity: Major
                    Found in src/DataFixtures/ORM/Projects.php - About 2 hrs to fix

                      Method postSuiteAction has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function postSuiteAction(Project $project, Campaign $campaign, Request $request)
                          {
                              if ($this->isInvalidToken($request, $project->getToken())) {
                                  return $this->getInvalidTokenView();
                              }
                      Severity: Major
                      Found in src/Controller/SuiteApiController.php - About 2 hrs to fix

                        Method parseTest has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function parseTest(SimpleXMLElement $xmlTestcase): testDTO
                            {
                                $test = new TestDTO();
                        
                                // Name is required
                        Severity: Minor
                        Found in src/Service/JunitParserService.php - About 1 hr to fix

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

                              private function parseSuiteTests(SimpleXMLElement $xmlTestsuite): suiteTests
                              {
                                  $suite = new SuiteDTO();
                                  $suiteTests = new SuiteTests($suite);
                          
                          
                          Severity: Minor
                          Found in src/Service/JunitParserService.php - About 1 hr to fix

                            Function parseTest has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function parseTest(SimpleXMLElement $xmlTestcase): testDTO
                                {
                                    $test = new TestDTO();
                            
                                    // Name is required
                            Severity: Minor
                            Found in src/Service/JunitParserService.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 load has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function load(ObjectManager $manager)
                                {
                                    $systemOut = <<<'EOT'
                            System out message :
                              - Out 1
                            Severity: Minor
                            Found in src/DataFixtures/ORM/Tests.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 formatErrorFailSkipMessage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function formatErrorFailSkipMessage(SimpleXMLElement $elt): string
                                {
                                    if (isset($elt['type'])) {
                                        $type = 'Type: '.(string) $elt['type'];
                                    } else {
                            Severity: Minor
                            Found in src/Service/JunitParserService.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 postSuiteAction has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function postSuiteAction(Project $project, Campaign $campaign, Request $request)
                                {
                                    if ($this->isInvalidToken($request, $project->getToken())) {
                                        return $this->getInvalidTokenView();
                                    }
                            Severity: Minor
                            Found in src/Controller/SuiteApiController.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 parseSuiteTests has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function parseSuiteTests(SimpleXMLElement $xmlTestsuite): suiteTests
                                {
                                    $suite = new SuiteDTO();
                                    $suiteTests = new SuiteTests($suite);
                            
                            
                            Severity: Minor
                            Found in src/Service/JunitParserService.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 refreshCampaign has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function refreshCampaign(Campaign $campaign, bool $all = false): void
                                {
                                    $repository = $this->doctrine->getRepository(Suite::class);
                                    $suites = $repository->findSuitesByCampaign($campaign);
                            
                            
                            Severity: Minor
                            Found in src/Service/RefreshService.php - About 1 hr to fix

                              Method fillInTestArray has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function fillInTestArray($passed, $failed, $errored, $skipped, $suite)
                                  {
                                      $count = $passed + $failed + $errored + $skipped;
                              
                                      $fillInArray = array();
                              Severity: Minor
                              Found in src/DataFixtures/ORM/Tests.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language