Showing 4,939 of 4,939 total issues
The method visitIf() has 159 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitIf(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
- Exclude checks
The class CLI has 2799 lines of code. Current threshold is 1000. Avoid really long classes. Open
class CLI
{
/**
* This should be updated to x.y.z-dev after every release, and x.y.z before a release.
*/
- Exclude checks
The method visitWhile() has an NPath complexity of 288. The configured NPath complexity threshold is 200. Open
public function visitWhile(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
)->withEnterLoop($node);
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method analyzeCallToFunctionLike() has an NPath complexity of 2700. The configured NPath complexity threshold is 200. Open
private function analyzeCallToFunctionLike(
FunctionInterface $method,
Node $node
): void {
$code_base = $this->code_base;
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method getElementsFromElementListForDeferredAnalysis() has an NPath complexity of 58321. The configured NPath complexity threshold is 200. Open
private static function getElementsFromElementListForDeferredAnalysis(
CodeBase $code_base,
iterable $element_list,
int $total_count,
int &$i
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method analyzeElementReferenceCounts() has 111 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function analyzeElementReferenceCounts(
CodeBase $code_base,
AddressableElement $element,
string $issue_type
): void {
- Exclude checks
The method loadMethodPlugins() has 110 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function loadMethodPlugins(CodeBase $code_base): void
{
$plugin_set = ConfigPluginSet::instance();
$return_type_overrides = $plugin_set->getReturnTypeOverrides($code_base);
$return_type_override_fqsen_strings = [];
- Exclude checks
The method visitReturn() has an NPath complexity of 23424. The configured NPath complexity threshold is 200. Open
public function visitReturn(Node $node): Context
{
$context = $this->context;
// Make sure we're actually returning from a method.
if (!$context->isInFunctionLikeScope()) {
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method analyzeCallableWithArgumentTypes() has an NPath complexity of 948. The configured NPath complexity threshold is 200. Open
public function analyzeCallableWithArgumentTypes(
array $argument_types,
FunctionInterface $method,
array $arguments = [],
bool $erase_old_return_type = false
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method analyzeSubstituteVarAssert() has an NPath complexity of 225. The configured NPath complexity threshold is 200. Open
private function analyzeSubstituteVarAssert(CodeBase $code_base, Context $context, string $text): void
{
$has_known_annotations = false;
if (\preg_match_all(self::PHAN_VAR_REGEX, $text, $matches, \PREG_SET_ORDER) > 0) {
$has_known_annotations = true;
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method visitFor() has 153 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitFor(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
- Exclude checks
The method visitWhile() has 105 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitWhile(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
)->withEnterLoop($node);
- Exclude checks
The method visitArrowFunc() has an NPath complexity of 216. The configured NPath complexity threshold is 200. Open
public function visitArrowFunc(Node $node): Context
{
$code_base = $this->code_base;
$context = $this->context->withoutLoops();
$closure_fqsen = FullyQualifiedFunctionName::fromClosureInContext(
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
Avoid using empty try-catch blocks in checkCanIterate. Open
} catch (RecursionDepthException $_) {
}
- Read upRead up
- Exclude checks
EmptyCatchBlock
Since: 2.7.0
Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.
Example
class Foo {
public function bar()
{
try {
// ...
} catch (Exception $e) {} // empty catch block
}
}
Source https://phpmd.org/rules/design.html#emptycatchblock
The method analyzeUnsetProp() has an NPath complexity of 264. The configured NPath complexity threshold is 200. Open
private function analyzeUnsetProp(Node $node): Context
{
$expr_node = $node->children['expr'];
$context = $this->context;
if (!($expr_node instanceof Node)) {
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method analyzeFunctions() has an NPath complexity of 216. The configured NPath complexity threshold is 200. Open
public static function analyzeFunctions(CodeBase $code_base, array $file_filter = null): void
{
$plugin_set = ConfigPluginSet::instance();
$has_function_or_method_plugins = $plugin_set->hasAnalyzeFunctionPlugins() || $plugin_set->hasAnalyzeMethodPlugins();
$show_progress = CLI::shouldShowProgress();
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The class BlockAnalysisVisitor has 3179 lines of code. Current threshold is 1000. Avoid really long classes. Open
class BlockAnalysisVisitor extends AnalysisVisitor
{
/**
* @var Node[]
- Exclude checks
The method visitMatchArmList() has 147 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitMatchArmList(Node $node): Context
{
// Make a copy of the internal context so that we don't
// leak any changes within the closed context to the
// outer scope
- Exclude checks
The method analyzeUnsetDim() has an NPath complexity of 1154. The configured NPath complexity threshold is 200. Open
private function analyzeUnsetDim(Node $node): void
{
$expr_node = $node->children['expr'];
if (!($expr_node instanceof Node)) {
// php -l would warn
- 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
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method warnNoopNew() has an NPath complexity of 222. The configured NPath complexity threshold is 200. Open
private function warnNoopNew(
Node $node,
array $class_list
): void {
$has_constructor_or_destructor = \count($class_list) === 0;
- 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
}
}