Showing 80 of 80 total issues
Avoid too many return
statements within this method. Open
Open
return Status::SUCCESS;
Avoid too many return
statements within this method. Open
Open
return $this->view($violations, Response::HTTP_BAD_REQUEST);
Function getStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getStatus(): int
{
if (0 === $this->getEnabled()) {
if ((0 === $this->getWarning()) && (0 === $this->getSuccess())) {
return Status::SUCCESS;
- Read upRead up
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
Open
public function load(ObjectManager $manager)
{
$ref1Date = new DateTime();
$ref1Date->setDate(2017, 7, 1)->setTime(12, 30, 1);
$ref2Date = new DateTime();
- Exclude checks
The method load() has 325 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
public function load(ObjectManager $manager)
{
$ref1Date = new DateTime();
$ref1Date->setDate(2017, 7, 1)->setTime(12, 30, 1);
$ref2Date = new DateTime();
- Exclude checks
The method load() has 251 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
public function load(ObjectManager $manager)
{
$systemOut = <<<'EOT'
System out message :
- Out 1
- Exclude checks
Line exceeds 120 characters; contains 322 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1/suites/1/limits -H "Content-Type: application/json" -H "X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001" -X PUT --data '{"warning":80, "success":95}'</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
Open
* description="Tests success limit. Integer between 0 and 100 %. Limit defined on project by default."
- Exclude checks
Line exceeds 120 characters; contains 228 characters Open
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.');
- Exclude checks
Line exceeds 120 characters; contains 205 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1 -H "X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001" -X DELETE</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one -X GET</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
Open
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
- Exclude checks
Line exceeds 120 characters; contains 216 characters Open
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),
- Exclude checks
Line exceeds 120 characters; contains 216 characters Open
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),
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/last -X GET</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 198 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/private -H "X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001" -X GET</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 202 characters Open
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),
- Exclude checks
Line exceeds 120 characters; contains 398 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one -H "Content-Type: application/json" -H "X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001" -X PUT --data '{"name":"Project To Update", "warning":85, "success":90, "email":"test-changed@example.com"}'</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 214 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1/suites/1 -H "X-CIR-TKN: 1f4ffb19e4b9-02278af07b7d-4e370a76f001" -X DELETE</code></pre>",
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
Open
* description="Example: </br><pre><code>curl https://www.ci-report.io/api/projects/project-one/campaigns/1 -X GET</code></pre>",
- Exclude checks