soliantconsulting/SimpleFM

View on GitHub
doc/filemaker/simplefm_example.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 4 of 4 total issues

Function arrayToParagraphs has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function arrayToParagraphs($value)
{
$count = count($value);
if ($count) {
$collapsedValue = '';
Severity: Minor
Found in doc/filemaker/simplefm_example.php - About 2 hrs to fix

The method arrayToParagraphs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
// repeating field
$collapsedValue .= implode(PHP_EOL, $value);
}
Severity: Minor
Found in doc/filemaker/simplefm_example.php by phpmd

The method stringifyValue uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$value = nl2br($value);
}
Severity: Minor
Found in doc/filemaker/simplefm_example.php by phpmd

The method arrayToParagraphs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
return " ";
}
Severity: Minor
Found in doc/filemaker/simplefm_example.php by phpmd
Category
Status