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();
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();
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
Suite
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Suite
{
const DEFAULT_NAME = 'DEFAULT_SUITE_NAME';
/**
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_';
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.
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.
Campaign
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Campaign
{
/**
* @var int
*
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.
Method load
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load(ObjectManager $manager)
{
$utilService = new UtilService();
$dataArray = array(
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();
}
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
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);
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 {
- 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
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
- 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
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
- 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
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);
- 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
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();
}
- 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
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);
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();