Showing 4,939 of 4,939 total issues
The method visitMethod() has an NPath complexity of 1080. The configured NPath complexity threshold is 200. Open
public function visitMethod(Node $node): Context
{
$method_name = (string)$node->children['name'];
$code_base = $this->code_base;
$context = $this->context;
- 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 analyzePropertyTypes() has an NPath complexity of 221. The configured NPath complexity threshold is 200. Open
public static function analyzePropertyTypes(CodeBase $code_base, Clazz $clazz): void
{
foreach ($clazz->getPropertyMap($code_base) as $property) {
// This phase is done before the analysis phase, so there aren't any dynamic properties to filter out.
- 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 visitForeach() has 132 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitForeach(Node $node): Context
{
$code_base = $this->code_base;
$context = $this->context;
$context->setLineNumberStart($node->lineno);
- Exclude checks
Avoid using empty try-catch blocks in warnOverridingFinalMethod. Open
} catch (CodeBaseException $_) {
}
- 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 visitClosure() has an NPath complexity of 1728. The configured NPath complexity threshold is 200. Open
public function visitClosure(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
The function phan_error_handler() has an NPath complexity of 9720. The configured NPath complexity threshold is 200. Open
function phan_error_handler(int $errno, string $errstr, string $errfile, int $errline): bool
{
global $__no_echo_phan_errors;
if ($__no_echo_phan_errors) {
if ($__no_echo_phan_errors instanceof Closure) {
- 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 visitArgList() has an NPath complexity of 1089. The configured NPath complexity threshold is 200. Open
public function visitArgList(Node $node): Context
{
$argument_name_set = [];
$has_unpack = 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 visitReturn() has 116 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitReturn(Node $node): Context
{
$context = $this->context;
// Make sure we're actually returning from a method.
if (!$context->isInFunctionLikeScope()) {
- Exclude checks
The method aliasTargetMapFromUseNode() has an NPath complexity of 386. The configured NPath complexity threshold is 200. Open
public static function aliasTargetMapFromUseNode(
Node $node,
string $prefix = '',
int $flags = 0
): array {
- 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 visitMatchArmList() has an NPath complexity of 6750. The configured NPath complexity threshold is 200. 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
- 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 visitTry() has 112 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitTry(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
- Exclude checks
The method checkUnionTypeCompatibility() has an NPath complexity of 288. The configured NPath complexity threshold is 200. Open
private function checkUnionTypeCompatibility(?Node $type): void
{
if (!$type) {
return;
}
- 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 analyzePassByReferenceArgument() has 109 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function analyzePassByReferenceArgument(
CodeBase $code_base,
Context $context,
Node $argument,
array $argument_list,
- Exclude checks
The method visitSwitchList() has 179 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitSwitchList(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 visitStaticCall() has 108 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitStaticCall(Node $node): Context
{
// Get the name of the method being called
$method_name = $node->children['method'];
- Exclude checks
The method analyzePassByReferenceArgument() has an NPath complexity of 348. The configured NPath complexity threshold is 200. Open
private static function analyzePassByReferenceArgument(
CodeBase $code_base,
Context $context,
Node $argument,
array $argument_list,
- 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 checkForInfiniteRecursionWithSameArgs() has an NPath complexity of 1168. The configured NPath complexity threshold is 200. Open
private function checkForInfiniteRecursionWithSameArgs(Node $node, FunctionInterface $method): void
{
$argument_list_node = $node->children['args'];
$parameter_list = $method->getParameterList();
if (\count($argument_list_node->children) !== \count($parameter_list)) {
- 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 loadMethodPlugins() has an NPath complexity of 784. The configured NPath complexity threshold is 200. 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 = [];
- 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 visitForeach() has an NPath complexity of 4032. The configured NPath complexity threshold is 200. Open
public function visitForeach(Node $node): Context
{
$code_base = $this->code_base;
$context = $this->context;
$context->setLineNumberStart($node->lineno);
- 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 checkCanIterate() has an NPath complexity of 504. The configured NPath complexity threshold is 200. Open
private function checkCanIterate(UnionType $union_type, Node $node): void
{
if ($union_type->isEmpty()) {
return;
}
- 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
}
}