Showing 4,939 of 4,939 total issues
The method __construct() 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 analyze() has an NPath complexity of 960. The configured NPath complexity threshold is 200. Open
public static function analyze(
FunctionInterface $method,
Node $node,
Context $context,
CodeBase $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 __construct() has an NPath complexity of 2112. The configured NPath complexity threshold is 200. Open
public function __construct(
array $process_task_data_iterator,
Closure $startup_closure,
Closure $task_closure,
Closure $shutdown_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 addMethod() has an NPath complexity of 3996. The configured NPath complexity threshold is 200. Open
public function addMethod(
CodeBase $code_base,
Method $method,
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 analyzeParameterList() has 172 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function analyzeParameterList(
CodeBase $code_base,
FunctionInterface $method,
Node $node,
Context $context
- Exclude checks
The method computeIntOrFloatOperationResult() has 127 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public static function computeIntOrFloatOperationResult(
Node $node,
UnionType $left,
UnionType $right
): UnionType {
- Exclude checks
The method combineScopeList() has 141 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function combineScopeList(array $scope_list): Context
{
if (\count($scope_list) < 2) {
throw new AssertionError("Expected at least two child contexts in " . __METHOD__);
}
- Exclude checks
The method getFlagInfo() has 156 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function getFlagInfo(): array
{
// TODO: Use AST's built in flag info if available.
static $exclusive, $combinable;
// Write this in a way that lets Phan infer the value of $combinable at the end.
- Exclude checks
The method getPropertyByNameInContext() has an NPath complexity of 4480. The configured NPath complexity threshold is 200. Open
public function getPropertyByNameInContext(
CodeBase $code_base,
string $name,
Context $context,
bool $is_static,
- 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 analyzeParameterListForCallback() has 127 lines of code. Current threshold is set to 100. Avoid really long methods. Open
private static function analyzeParameterListForCallback(
CodeBase $code_base,
FunctionInterface $method,
array $arg_nodes,
Context $context,
- Exclude checks
The method analyzeParameter() has an NPath complexity of 1493856. The configured NPath complexity threshold is 200. 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 =
- 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 106 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function visitBinaryAdd(Node $node): UnionType
{
$code_base = $this->code_base;
$context = $this->context;
$left = UnionTypeVisitor::unionTypeFromNode(
- Exclude checks
The method mergeCatchContext() has an NPath complexity of 288. The configured NPath complexity threshold is 200. Open
public function mergeCatchContext(Node $node): Context
{
if (\count($this->child_context_list) < 2) {
throw new AssertionError("Expected at least two contexts in " . __METHOD__);
}
- 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 analyzeOverrideSignatureForOverriddenMethod() has an NPath complexity of 263023200. The configured NPath complexity threshold is 200. Open
private static function analyzeOverrideSignatureForOverriddenMethod(
CodeBase $code_base,
Method $method,
Clazz $class,
Method $o_method
- 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 analyzeOverrideRealSignature() has an NPath complexity of 2941596. The configured NPath complexity threshold is 200. Open
private static function analyzeOverrideRealSignature(
CodeBase $code_base,
Method $method,
Clazz $class,
Method $o_method,
- 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 run() has an NPath complexity of 268. The configured NPath complexity threshold is 200. Open
public static function run(CodeBase $code_base, Closure $file_path_lister): ?Request
{
if (Config::getValue('language_server_use_pcntl_fallback')) {
self::runWithoutPcntl($code_base, $file_path_lister);
// Not reachable
- 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 createDaemonStreamSocketServer() contains an exit expression. Open
exit(1);
- 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 streamForParent() 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 suggestVariableTypoFix() has an NPath complexity of 2352. The configured NPath complexity threshold is 200. Open
public static function suggestVariableTypoFix(CodeBase $code_base, Context $context, string $variable_name, string $prefix = 'Did you mean'): ?Suggestion
{
if (Config::getValue('disable_suggestions')) {
return 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 method addMethod() has 122 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function addMethod(
CodeBase $code_base,
Method $method,
Option $type_option
): void {
- Exclude checks