Showing 4,939 of 4,939 total issues
The method recordHoverTextForElementType() has an NPath complexity of 1800. The configured NPath complexity threshold is 200. Open
private function recordHoverTextForElementType(
CodeBase $code_base,
Context $context,
TypedElementInterface $element
): 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 analyzeFileList() 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 visitClass() has an NPath complexity of 400. The configured NPath complexity threshold is 200. Open
public function visitClass(Node $node): Context
{
if ($node->flags & \ast\flags\CLASS_ANONYMOUS) {
$class_name = (new ContextNode(
$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 analyzeFileList() contains an exit expression. Open
exit(2);
- 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 finishAnalyzingRemainingStatements() contains an exit expression. Open
exit(0);
- 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 processGraph() utilizes a goto statement. Open
goto cfound;
- Read upRead up
- Exclude checks
GotoStatement
Since: 1.1.0
Goto makes code harder to read and it is nearly impossible to understand the control flow of an application that uses this language construct. Therefore it should be avoided. Consider to replace Goto with regular control structures and separate methods/function, which are easier to read.
Example
class Foo {
public function bar($param) {
A:
if ($param === 42) {
goto X;
}
Y:
if (time() % 42 === 23) {
goto Z;
}
X:
if (time() % 23 === 42) {
goto Y;
}
Z:
return 42;
}
}
Source https://phpmd.org/rules/design.html#gotostatement
The method addProperty() has an NPath complexity of 1709696. The configured NPath complexity threshold is 200. Open
private function addProperty(Clazz $class, string $property_name, $default_node, UnionType $real_union_type, ?Comment\Parameter $variable, int $lineno, int $flags, ?string $doc_comment, Comment $property_comment): ?Property
{
$variable_has_literals = $variable && $variable->getUnionType()->hasLiterals();
// If something goes wrong will getting the type of
- 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 getReturnTypeOverridesStatic() has 135 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function getReturnTypeOverridesStatic(): array
{
/**
* @param list<Node|int|string|float> $args
*/
- Exclude checks
The method finalizeProcess() has an NPath complexity of 1924. The configured NPath complexity threshold is 200. Open
public function finalizeProcess(CodeBase $code_base): void
{
if (empty($this->elements)) {
\fwrite(\STDERR, "Nothing to analyze - please run pdep from your top-level project directory" . \PHP_EOL);
exit(\EXIT_FAILURE);
- 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 processGraph() 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 finalizeProcess() contains an exit expression. Open
exit(0);
- 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 function check_fields() has 184 lines of code. Current threshold is set to 100. Avoid really long methods. Open
function check_fields(string $function_name, array $fields, array $signatures): void
{
$return_type = $fields[0]; // TODO: Check type
if (!is_string($return_type)) {
throw new InvalidArgumentException("Invalid return type: " . json_encode($return_type));
- Exclude checks
The method getAnalyzeFunctionCallClosuresStatic() has an NPath complexity of 9223372036854775807. The configured NPath complexity threshold is 200. Open
private static function getAnalyzeFunctionCallClosuresStatic(): array
{
$stop_exception = new StopParamAnalysisException();
/**
- 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 analyzeNode() has an NPath complexity of 103680. The configured NPath complexity threshold is 200. Open
private function analyzeNode(Node $stmts): array
{
$kind = $stmts->kind;
switch ($kind) {
// Nodes that create new scopes
- 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 analyzeFileList() has an NPath complexity of 2799360. The configured NPath complexity threshold is 200. Open
public static function analyzeFileList(
CodeBase $code_base,
Closure $file_path_lister
): bool {
if (Config::getValue('dump_parsed_file_list') === 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 getReturnTypeOverridesStatic() has 662 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function getReturnTypeOverridesStatic(): array
{
$mixed_type = MixedType::instance(false);
$false_type = FalseType::instance(false);
$array_type = ArrayType::instance(false);
- Exclude checks
The method getReplacementTypesForFullyQualifiedClassName() 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 function dump_main() contains an exit expression. Open
exit($exit_code);
- 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 updateSignature() has an NPath complexity of 954. The configured NPath complexity threshold is 200. Open
protected function updateSignature(string $function_like_name, array $arguments_from_phan): array
{
$return_type = $arguments_from_phan[0];
$arguments_from_external_stub = $this->parseFunctionLikeSignature($function_like_name);
if (is_null($arguments_from_external_stub)) {
- 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 compareNamedParameters() contains an exit expression. Open
exit(0);
- 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);
}
}
}