Showing 188 of 188 total issues
Expected 1 blank line at end of file; 2 found Open
];
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
];
- Exclude checks
Avoid too many return
statements within this method. Open
return '';
Function setInputs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setInputs($inputs)
{
$inputs['entity_key'] = "part";
if (empty($inputs['vehicle_id'])) {
unset($inputs['vehicle_id']);
- 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 results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function results($filters = [])
{
$types = $this->scopeQuery(function ($query) use ($filters) {
$query = $query->select('types.*', 'types.entity_key as entity-key');
- 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 getFleetSensorDatetimeData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getFleetSensorDatetimeData($fleetTireData)
{
if (!empty($fleetTireData)) {
foreach ($fleetTireData as $idVehicle => $tireData) {
$lastDatetimeData = $this->getLastDatetimeData($tireData);
- 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
Avoid using App\Repositories\count() function in for loops. Open
for ($i = $positionOrder; $i < count($historicalDataPos); $i++) {
$historicalData[$countPoints][substr($dataPos->created_at, 11)] .= ", null, null";
}
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Avoid using App\Repositories\count() function in for loops. Open
for ($index = 1; $index <= count($chartElements); $index++) {
$tireSensorData['columns'][$value][] = ($key * count($chartElements)) + $index;
}
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Line exceeds 120 characters; contains 144 characters Open
"required_if" => "É obrigatória a indicação de um valor para o campo :attribute quando o valor do campo :other é igual a :value.",
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
class='$class mdl-color-text--primary-dark mdl-button mdl-js-button mdl-js-ripple-effect button-link'
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
"required_with_all" => "É obrigatória a indicação de um valor para o campo :attribute quando um dos :values está presente.",
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
"required_without_all" => "É obrigatória a indicação de um valor para o campo :attribute quando nenhum dos :values está presente.",
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
"required_without" => "É obrigatória a indicação de um valor para o campo :attribute quanto :values não está presente.",
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
"required_with" => "É obrigatória a indicação de um valor para o campo :attribute quando :values está presente.",
- Exclude checks
Expected 1 newline at end of file; 0 found Open
];
- Exclude checks
Expected 1 newline at end of file; 0 found Open
];
- Exclude checks
Expected 1 newline at end of file; 0 found Open
];
- Exclude checks
HACK found Open
* HACK: Even though the intention is to have the current .mdl-spinner__layer-N
- Exclude checks
TODO found Open
// TODO: remove 'name' arg after deprecation is removed
- Exclude checks
TODO found Open
// TODO: Move this to another part of the creation flow to prevent circular deps
- Exclude checks