Showing 4,939 of 4,939 total issues
The method generateClosure() has an NPath complexity of 338. The configured NPath complexity threshold is 200. Open
private static function generateClosure(array $callable_params, array $class_params): Closure
{
$key = \json_encode([$callable_params, $class_params]);
static $cache = [];
$closure = $cache[$key] ?? null;
- 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 'getPhanFlagsHasState()' method which returns a boolean should be named 'is...()' or 'has...()' Open
public function getPhanFlagsHasState(int $flag): bool
{
return ($this->phan_flags & $flag) === $flag;
}
- Read upRead up
- Exclude checks
BooleanGetMethodName
Since: 0.2
Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
Example
class Foo {
/**
* @return boolean
*/
public function getFoo() {} // bad
/**
* @return bool
*/
public function isFoo(); // ok
/**
* @return boolean
*/
public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}
Source https://phpmd.org/rules/naming.html#booleangetmethodname
The method fromFullyQualifiedStringInner() has an NPath complexity of 18144. The configured NPath complexity threshold is 200. Open
protected static function fromFullyQualifiedStringInner(
string $fully_qualified_string
): Type {
if ($fully_qualified_string === '') {
throw new InvalidArgumentException("Type cannot be empty");
- 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 canCastToUnionTypeWithoutConfig() has an NPath complexity of 1728. The configured NPath complexity threshold is 200. Open
public function canCastToUnionTypeWithoutConfig(
UnionType $target
): bool {
// Fast-track most common cases first
$type_set = $this->type_set;
- 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 orderForProcessCount() has an NPath complexity of 4320. The configured NPath complexity threshold is 200. Open
public function orderForProcessCount(
int $process_count,
array $analysis_file_list
): 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 analyzeFileList() contains an exit expression. Open
exit(EXIT_SUCCESS);
- 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 asNormalizedTypeSetInner() has an NPath complexity of 384. The configured NPath complexity threshold is 200. Open
private static function asNormalizedTypeSetInner(array $type_set): array
{
if (\count($type_set) <= 1) {
return $type_set;
}
- 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 an NPath complexity of 331776. The configured NPath complexity threshold is 200. Open
private static function getReturnTypeOverridesStatic(): array
{
/**
* @param list<Node|int|string|float> $args
*/
- 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_SUCCESS);
- 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 newInstance() 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 ensurePluginsExist() 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(\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 finishAnalyzingRemainingStatements() has an NPath complexity of 9224. The configured NPath complexity threshold is 200. Open
public static function finishAnalyzingRemainingStatements(
CodeBase $code_base,
?Request $request,
array $analyze_file_path_list,
array $temporary_file_mapping
- 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() has an NPath complexity of 39424. The configured NPath complexity threshold is 200. Open
public function processGraph(array $cached_graph = null): void
{
$cmd = $_ENV['PDEP_CMD'];
$mode = $_ENV['PDEP_MODE'];
$this->depth = (int)$_ENV['PDEP_DEPTH'];
- 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 orderForProcessCount() has 119 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function orderForProcessCount(
int $process_count,
array $analysis_file_list
): array {
- Exclude checks
The method ensurePluginsExist() has 132 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private function ensurePluginsExist(): void
{
if (!is_null($this->plugin_set)) {
return;
}
- Exclude checks
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 visitClass() has 142 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitClass(Node $node): Context
{
if ($node->flags & \ast\flags\CLASS_ANONYMOUS) {
$class_name = (new ContextNode(
$this->code_base,
- Exclude checks
The method analyzeFileList() contains an exit expression. Open
exit(EXIT_SUCCESS);
- 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 ensurePluginsExist() has an NPath complexity of 93312. The configured NPath complexity threshold is 200. Open
private function ensurePluginsExist(): void
{
if (!is_null($this->plugin_set)) {
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
}
}