Showing 4,939 of 4,939 total issues
The method importAncestorClass() has an NPath complexity of 1512. The configured NPath complexity threshold is 200. Open
public function importAncestorClass(
CodeBase $code_base,
Clazz $class,
Option $type_option
): void {
- 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 analyzeParameter() has 121 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function analyzeParameter(CodeBase $code_base, Context $context, FunctionInterface $method, UnionType $argument_type, int $lineno, int $i, $argument_node, ?Node $node): void
{
// Expand it to include all parent types up the chain
try {
$argument_type_expanded_resolved =
- Exclude checks
The method analyzeShapedArrayAssignment() has 101 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private function analyzeShapedArrayAssignment(Node $node): void
{
// Figure out the type of elements in the list
$fallback_element_type = null;
/** @suppress PhanAccessMethodInternal */
- Exclude checks
The method addTypesToPropertyStandalone() has an NPath complexity of 222. The configured NPath complexity threshold is 200. Open
public static function addTypesToPropertyStandalone(
CodeBase $code_base,
Context $context,
Property $property,
UnionType $new_types
- 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 visitVar() has 144 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitVar(Node $node): Context
{
try {
$variable_name = (new ContextNode(
$this->code_base,
- Exclude checks
The method analyzeRealSignatureCompatibility() has an NPath complexity of 14162. The configured NPath complexity threshold is 200. Open
private static function analyzeRealSignatureCompatibility(CodeBase $code_base, FunctionInterface $method, int $minimum_target_php_version): void
{
$php70_checks = $minimum_target_php_version < 70100;
foreach ($method->getRealParameterList() as $real_parameter) {
- 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 analyzePropAssignment() has 103 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private function analyzePropAssignment(Clazz $clazz, Property $property, Node $node): Context
{
if ($property->isReadOnly()) {
$this->analyzeAssignmentToReadOnlyProperty($property, $node);
}
- Exclude checks
The method checkInvalidArrayShapeCombination() has an NPath complexity of 4104. The configured NPath complexity threshold is 200. Open
public static function checkInvalidArrayShapeCombination(
CodeBase $code_base,
Context $context,
Node $node,
UnionType $left,
- 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 analyzeRealSignatureCompatibility() has 140 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function analyzeRealSignatureCompatibility(CodeBase $code_base, FunctionInterface $method, int $minimum_target_php_version): void
{
$php70_checks = $minimum_target_php_version < 70100;
foreach ($method->getRealParameterList() as $real_parameter) {
- Exclude checks
The method __construct() contains an exit expression. Open
exit(EXIT_FAILURE);
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
The method fromReflectionClass() has an NPath complexity of 96000. The configured NPath complexity threshold is 200. Open
public static function fromReflectionClass(
CodeBase $code_base,
ReflectionClass $class
): Clazz {
// Build a set of flags based on the constitution
- 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 fromReflectionClass() has 226 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function fromReflectionClass(
CodeBase $code_base,
ReflectionClass $class
): Clazz {
// Build a set of flags based on the constitution
- Exclude checks
The method toStubSignature() has an NPath complexity of 576. The configured NPath complexity threshold is 200. Open
private function toStubSignature(CodeBase $code_base): string
{
$string = '';
if ($this->isFinal()) {
- 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 parseCommentLine() has an NPath complexity of 360. The configured NPath complexity threshold is 200. Open
private function parseCommentLine(int $i, string $line): void
{
// https://secure.php.net/manual/en/regexp.reference.internal-options.php
// (?i) makes this case-sensitive, (?-1) makes it case-insensitive
// phpcs:ignore Generic.Files.LineLength.MaxExceeded
- 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 visitBinaryAdd() has an NPath complexity of 2040. The configured NPath complexity threshold is 200. Open
public function visitBinaryAdd(Node $node): UnionType
{
$code_base = $this->code_base;
$context = $this->context;
$left = UnionTypeVisitor::unionTypeFromNode(
- 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 visitBinaryAdd() has an NPath complexity of 840. The configured NPath complexity threshold is 200. Open
public function visitBinaryAdd(Node $node): UnionType
{
static $int_or_float_or_array;
static $probably_int_type;
static $probably_array_type;
- 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 visitDim() has an NPath complexity of 432. The configured NPath complexity threshold is 200. Open
public function visitDim(Node $node): Context
{
$expr_node = $node->children['expr'];
if (!($expr_node instanceof Node)) {
$this->emitIssue(
- 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 visitProp() has an NPath complexity of 5824. The configured NPath complexity threshold is 200. Open
public function visitProp(Node $node): Context
{
// Get class list first, warn if the class list is invalid.
try {
$class_list = (new ContextNode(
- 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 ConditionVisitor has 1190 lines of code. Current threshold is 1000. Avoid really long classes. Open
class ConditionVisitor extends KindVisitorImplementation implements ConditionVisitorInterface
{
use ConditionVisitorUtil;
/** @internal */
- Exclude checks
The method createNegationCallbackMap() has an NPath complexity of 648. The configured NPath complexity threshold is 200. Open
private static function createNegationCallbackMap(): array
{
/** @param list<Node|mixed> $unused_args */
$remove_null_cb = static function (CodeBase $unused_code_base, Context $unused_context, Variable $variable, array $unused_args): void {
$variable->setUnionType($variable->getUnionType()->nonNullableClone());
- 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
}
}