Showing 30 of 38 total issues
Avoid too many return
statements within this method. Open
Open
return $this->complexCompare($a->asComplex(), $b);
Missing class import via use statement (line '63', column '23'). Open
Open
throw new \InvalidArgumentException('No known comparator engine');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid too many return
statements within this method. Open
Open
return $this->calcEngine->complexAdd($a->asComplex(), $b);
Avoid too many return
statements within this method. Open
Open
return $this->calcEngine->complexSub($a, $b);
Missing class import via use statement (line '582', column '23'). Open
Open
throw new \BadMethodCallException('Cannot compute reciprocal of zero complex number');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid too many return
statements within this method. Open
Open
return $this->calcEngine->complexDiv($a->asComplex(), $b);
Avoid too many return
statements within this method. Open
Open
return 'whole';
Missing class import via use statement (line '69', column '23'). Open
Open
throw new \InvalidArgumentException('No known calculator engine');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid too many return
statements within this method. Open
Open
return $this->calcEngine->complexAdd($a, $b);
The method arbitrate() has an NPath complexity of 256. The configured NPath complexity threshold is 200. Open
Open
protected function arbitrate(NumericTypeInterface $a, NumericTypeInterface $b)
{
$pairing = $this->getTypePairing($a, $b);
if ($pairing == 'complex:complex') {
return 'complex';
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}