Showing 158 of 160 total issues
Function get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Confirmed
Confirmed
protected static function get($items) {
if (is_array($items))
{
$max = 0;
foreach ($items as $key => $value) {
- 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
Spaces must be used for alignment; tabs are not allowed Open
Open
private function calc_rate($item_list, $items, $rate)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class Roll extends Roulette {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$item = [];
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class RateUp {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
if (is_array($items))
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$item[$itm] = $item_list[$itm] * ($rate / 100);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
return $rt->calc_rate($item_list, $items, $rate);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
foreach ($items as $itm)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
} else {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
{
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class Roulette extends RateUp {
- Exclude checks
Method name "_itemDropUp" should not be prefixed with an underscore to indicate visibility Open
Open
protected static function _itemDropUp($item_list, $items, $rate)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
Open
$item[$items] = $item_list[$items] * ($rate / 100);
- Exclude checks