jfx/ci-report

View on GitHub

Showing 80 of 80 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function findNextCampaignByProject(Project $project, Campaign $campaign): ?Campaign
    {
        $qb = $this->createQueryBuilder('c')
            ->innerJoin('c.project', 'p')
            ->where('p.id = :projectId')
Severity: Major
Found in src/Repository/CampaignRepository.php and 3 other locations - About 1 hr to fix
src/Repository/CampaignRepository.php on lines 114..128
src/Repository/SuiteRepository.php on lines 98..112
src/Repository/SuiteRepository.php on lines 122..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function findPrevSuiteByCampaign(Campaign $campaign, Suite $suite): ?Suite
    {
        $qb = $this->createQueryBuilder('s')
            ->innerJoin('s.campaign', 'c')
            ->where('c.id = :campaignId')
Severity: Major
Found in src/Repository/SuiteRepository.php and 3 other locations - About 1 hr to fix
src/Repository/CampaignRepository.php on lines 114..128
src/Repository/CampaignRepository.php on lines 138..152
src/Repository/SuiteRepository.php on lines 122..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function findNextSuiteByCampaign(Campaign $campaign, Suite $suite): ?Suite
    {
        $qb = $this->createQueryBuilder('s')
            ->innerJoin('s.campaign', 'c')
            ->where('c.id = :campaignId')
Severity: Major
Found in src/Repository/SuiteRepository.php and 3 other locations - About 1 hr to fix
src/Repository/CampaignRepository.php on lines 114..128
src/Repository/CampaignRepository.php on lines 138..152
src/Repository/SuiteRepository.php on lines 98..112

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    public function findPrevCampaignByProject(Project $project, Campaign $campaign): ?Campaign
    {
        $qb = $this->createQueryBuilder('c')
            ->innerJoin('c.project', 'p')
            ->where('p.id = :projectId')
Severity: Major
Found in src/Repository/CampaignRepository.php and 3 other locations - About 1 hr to fix
src/Repository/CampaignRepository.php on lines 138..152
src/Repository/SuiteRepository.php on lines 98..112
src/Repository/SuiteRepository.php on lines 122..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 112.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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 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 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 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 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

    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

    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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public function getStatusColorClass($status): string
            {
                switch ($status) {
                    case Test::ERRORED:
                    case Test::FAILED:
        Severity: Major
        Found in src/Twig/BootstrapStatusClassExtension.php and 1 other location - About 1 hr to fix
        src/Twig/BootstrapStatusClassExtension.php on lines 101..121

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method validate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function validate(DOMDocument $domDoc): array
            {
                libxml_use_internal_errors(true);
                libxml_clear_errors();
        
        
        Severity: Minor
        Found in src/Service/JunitParserService.php - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function getStatusIconClass($status): string
              {
                  switch ($status) {
                      case Test::ERRORED:
                      case Test::FAILED:
          Severity: Major
          Found in src/Twig/BootstrapStatusClassExtension.php and 1 other location - About 1 hr to fix
          src/Twig/BootstrapStatusClassExtension.php on lines 72..92

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 102.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method postZipDocumentAction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function postZipDocumentAction(Project $project, Campaign $campaign, Suite $suite, Request $request)
              {
                  if ($this->isInvalidToken($request, $project->getToken())) {
                      return $this->getInvalidTokenView();
                  }
          Severity: Minor
          Found in src/Controller/DocumentApiController.php - About 1 hr to fix

            Method formatErrorFailSkipMessage has 26 lines of code (exceeds 25 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

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

                  public function getContent(): array
                  {
                      $fileNameWithPath = $this->targetDir.'/'.$this->fileName;
              
                      if (!file_exists($fileNameWithPath)) {
              Severity: Minor
              Found in src/Entity/ZipFile.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

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

                  public function fillInTestArray($passed, $failed, $errored, $skipped, $suite)
              Severity: Minor
              Found in src/DataFixtures/ORM/Tests.php - About 35 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $suitesEntity;
                Severity: Major
                Found in src/Controller/SuiteApiController.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language