jfx/ci-report

View on GitHub

Showing 29 of 80 total issues

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

    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

            Avoid too many return statements within this method.
            Open

                    return Status::SUCCESS;
            Severity: Major
            Found in src/Entity/Suite.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return $this->view($violations, Response::HTTP_BAD_REQUEST);
              Severity: Major
              Found in src/Controller/SuiteApiController.php - About 30 mins to fix

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

                    public function getStatus(): int
                    {
                        if (0 === $this->getEnabled()) {
                            if ((0 === $this->getWarning()) && (0 === $this->getSuccess())) {
                                return Status::SUCCESS;
                Severity: Minor
                Found in src/Entity/Suite.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