modules/custom/lter_unit/lib/LterUnitStmmlHelper.php
Function getUnitStmml
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getUnitStmml($unit, $use_cache = FALSE) {
$stmml = NULL;
$dom = new DOMDocument();
try {
- 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 getUnitStmml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getUnitStmml($unit, $use_cache = FALSE) {
$stmml = NULL;
$dom = new DOMDocument();
try {
Additional blank lines found at end of doc comment Open
Open
*/
- Exclude checks
The closing brace for the class must have an empty line before it Open
Open
}
- Exclude checks
Expected 1 blank line after function; 0 found Open
Open
}
- Exclude checks
Missing class doc comment Open
Open
class LterUnitStmmlHelper {
- Exclude checks
Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses Open
Open
// Inspect all the child elements of stmml:unitList
- Exclude checks
Parameter tags must be grouped together in a doc comment Open
Open
* @param bool $use_cache
- Exclude checks
Missing parameter comment Open
Open
* @param bool $use_cache
- Exclude checks