Showing 29 of 80 total issues
Method validate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate(DOMDocument $domDoc): array
{
libxml_use_internal_errors(true);
libxml_clear_errors();
Method postZipDocumentAction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function postZipDocumentAction(Project $project, Campaign $campaign, Suite $suite, Request $request)
{
if ($this->isInvalidToken($request, $project->getToken())) {
return $this->getInvalidTokenView();
}
Method formatErrorFailSkipMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function formatErrorFailSkipMessage(SimpleXMLElement $elt): string
{
if (isset($elt['type'])) {
$type = 'Type: '.(string) $elt['type'];
} else {
Function getContent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getContent(): array
{
$fileNameWithPath = $this->targetDir.'/'.$this->fileName;
if (!file_exists($fileNameWithPath)) {
- 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 fillInTestArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function fillInTestArray($passed, $failed, $errored, $skipped, $suite)
Avoid too many return
statements within this method. Open
Open
return $suitesEntity;
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"