protected/commands/ImportStatistikCommand.php
The method ImportStatistikCommand::run() calls the typical debug function var_dump() which is mostly only used during development. Open
Open
if (!$dat->save()) var_dump($dat->getErrors());
- Read upRead up
- Exclude checks
DevelopmentCodeFragment
Since: 2.3.0
Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.
Example
class SuspectCode {
public function doSomething(array $items)
{
foreach ($items as $i => $item) {
// …
if ('qafoo' == $item) var_dump($i);
// …
}
}
}
Source https://phpmd.org/rules/design.html#developmentcodefragment
Method run
has 42 lines of code (exceeds 30 allowed). Consider refactoring. Open
Open
public function run($args)
{
// Etwas eigene Statistik
$start_time = microtime(true);
$rows_imported = 0;
Avoid unused parameters such as '$args'. Open
Open
public function run($args)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}