Showing 3,272 of 4,939 total issues
Method checkPropertyCompatibility
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function checkPropertyCompatibility(
CodeBase $code_base,
Property $inherited_property,
Property $overriding_property
): void {
Method analyzeBinaryBoolAnd
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function analyzeBinaryBoolAnd(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
Method analyzeBinaryBoolOr
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function analyzeBinaryBoolOr(Node $node): Context
{
$context = $this->context->withLineNumberStart(
$node->lineno
);
Method isMatchingNamespaceUseDeclaration
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function isMatchingNamespaceUseDeclaration(
string $file_contents,
NamespaceUseDeclaration $declaration,
IssueInstance $issue_instance
): bool {
Method runWithoutPcntl
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function runWithoutPcntl(CodeBase $code_base, Closure $file_path_lister): void
{
// This is a single threaded server, it only analyzes one TCP request at a time
$socket_server = self::createDaemonStreamSocketServer();
try {
Method visitCast
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitCast(Node $node): void
{
// TODO: Check if the cast would throw an error at runtime, based on the type (e.g. casting object to string/int)
$expr_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']);
if (!$expr_type->hasRealTypeSet()) {
Method emitIssueForInArray
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function emitIssueForInArray(CodeBase $code_base, Context $context, array $args, ?Node $node): void
{
[$needle_node, $haystack_node] = $args;
$needle = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $needle_node);
$haystack = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $haystack_node);
Method emitIssueForArrayKeyExists
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function emitIssueForArrayKeyExists(CodeBase $code_base, Context $context, array $args, ?Node $node): void
{
[$key_node, $array_node] = $args;
$key_type = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $key_node);
$array_type = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $array_node);
Method analyzeBinaryConditionSide
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeBinaryConditionSide(Node $var_node, $expr_node, BinaryCondition $condition): ?Context
{
'@phan-var ConditionVisitorUtil|ConditionVisitorInterface $this';
$kind = $var_node->kind;
if ($kind === ast\AST_VAR || $kind === ast\AST_DIM) {
Method addPromotedConstructorPropertyFromParam
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addPromotedConstructorPropertyFromParam(
Clazz $class,
Method $method,
Parameter $parameter,
Node $parameter_node
Method visitInstanceof
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitInstanceof(Node $node): Context
{
//$this->checkVariablesDefined($node);
// Only look at things of the form
// `$variable instanceof ClassName`
Method analyzeUnsetProp
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeUnsetProp(Node $node): Context
{
$expr_node = $node->children['expr'];
$context = $this->context;
if (!($expr_node instanceof Node)) {
Method getReturnTypes
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getReturnTypes(Context $context, $node, int $return_lineno): \Generator
{
if (!($node instanceof Node)) {
if (null === $node) {
yield $return_lineno => [VoidType::instance(false)->asRealUnionType(), null];
Method visitStmtList
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitStmtList(Node $node): void
{
$child_nodes = $node->children;
$last_node_index = count($child_nodes) - 1;
Method visitAssign
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitAssign(Node $node): void
{
$expr = $node->children['expr'];
if (!$expr instanceof Node) {
// Guaranteed not to contain duplicate expressions in valid php assignments.
Method resolveClassAliasesForAliasSet
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function resolveClassAliasesForAliasSet(FullyQualifiedClassName $original_fqsen, Set $alias_set): void
{
if (!$this->hasClassWithFQSEN($original_fqsen)) {
// The original class does not exist.
// Emit issues at the point of every single class_alias call with that original class.
Method restartWithoutProblematicExtensions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function restartWithoutProblematicExtensions(): void
{
$extensions_to_disable = [];
if (self::shouldRestartToExclude('xdebug')) {
$extensions_to_disable[] = 'xdebug';
Method fromReflectionParameter
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function fromReflectionParameter(
\ReflectionParameter $reflection_parameter
): Parameter {
$flags = 0;
// Check to see if it's a pass-by-reference parameter
Method setMagicMethodMap
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setMagicMethodMap(
array $magic_method_map,
CodeBase $code_base
): bool {
if (count($magic_method_map) === 0) {
Method createUseAlias
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createUseAlias(
Clazz $clazz,
string $alias_method_name,
int $new_visibility_flags
): Method {