jfx/ci-report

View on GitHub

Showing 80 of 80 total issues

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

      The method load() has 260 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

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

      The method load() has 325 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

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

      The method load() has 251 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

          public function load(ObjectManager $manager)
          {
              $systemOut = <<<'EOT'
      System out message :
        - Out 1
      Severity: Minor
      Found in src/DataFixtures/ORM/Tests.php by phpmd

      Line exceeds 120 characters; contains 322 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1/suites/1/limits -H &quot;Content-Type: application/json&quot; -H &quot;X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001&quot; -X PUT --data '{&quot;warning&quot;:80, &quot;success&quot;:95}'</code></pre>",

      Line exceeds 120 characters; contains 122 characters
      Open

           *                description="Tests success limit. Integer between 0 and 100 %. Limit defined on project by default."

      Line exceeds 120 characters; contains 228 characters
      Open

              throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
      Severity: Minor
      Found in public/index.php by phpcodesniffer

      Line exceeds 120 characters; contains 205 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1 -H &quot;X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001&quot; -X DELETE</code></pre>",

      Line exceeds 120 characters; contains 125 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one -X GET</code></pre>",

      Line exceeds 120 characters; contains 130 characters
      Open

          Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
      Severity: Minor
      Found in public/index.php by phpcodesniffer

      Line exceeds 120 characters; contains 216 characters
      Open

                      'status' => array(Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED),

      Line exceeds 120 characters; contains 216 characters
      Open

                      'status' => array(Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED),

      Line exceeds 120 characters; contains 140 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/last -X GET</code></pre>",

      Line exceeds 120 characters; contains 198 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/private -H &quot;X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001&quot; -X GET</code></pre>",

      Line exceeds 120 characters; contains 202 characters
      Open

                      'status' => array(Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED, Test::PASSED),

      Line exceeds 120 characters; contains 398 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one -H &quot;Content-Type: application/json&quot; -H &quot;X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001&quot; -X PUT --data '{&quot;name&quot;:&quot;Project To Update&quot;, &quot;warning&quot;:85, &quot;success&quot;:90, &quot;email&quot;:&quot;test-changed@example.com&quot;}'</code></pre>",

      Line exceeds 120 characters; contains 214 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1/suites/1 -H &quot;X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001&quot; -X DELETE</code></pre>",

      Line exceeds 120 characters; contains 137 characters
      Open

           *     description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1 -X GET</code></pre>",
      Severity
      Category
      Status
      Source
      Language