Showing 3,272 of 4,939 total issues
Method canCastToDeclaredType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function canCastToDeclaredType(CodeBase $code_base, Context $context, Type $type): bool
{
if ($type instanceof ScalarType) {
switch ($type::NAME) {
case 'string':
Method asGeneratorTemplateType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function asGeneratorTemplateType(): Type
{
$fallback_values = UnionType::empty();
$fallback_keys = UnionType::empty();
Method canCastToType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function canCastToType(Type $type): bool
{
// Check to see if we have an exact object match
if ($this === $type) {
return true;
Method getTemplateTypeExtractorClosure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTemplateTypeExtractorClosure(CodeBase $code_base, TemplateType $template_type): ?Closure
{
if (!$this->template_parameter_type_list) {
return null;
}
Method closureParamComponentStringsToParams
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function closureParamComponentStringsToParams(array $param_components, Context $context, int $source): array
{
$result = [];
foreach ($param_components as $param_string) {
if ($param_string === '') {
Method suggestSimilarClassPropertiesToGlobalConstant
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function suggestSimilarClassPropertiesToGlobalConstant(CodeBase $code_base, Context $context, FullyQualifiedGlobalConstantName $fqsen): array
{
if (!$context->isInClassScope()) {
return [];
}
Method createClosures
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function createClosures(): array
{
/**
* @return ?FileEditSet
*/
Method matchesParamTypes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function matchesParamTypes(CodeBase $code_base, array $search_param_types, array $signature_param_types): float
{
if (\count($search_param_types) === 0) {
// Award extra points for having the same number of matches
return \max(1, 5 - count($signature_param_types)) / 2;
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function initialize(): void
{
// Create a shutdown function to emit the log when we're
// all done
Method analyzeAssignmentTarget
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeAssignmentTarget($node, bool $is_ref, $const_expr): VariableTrackingScope
{
// TODO: Push onto the node list?
if (!($node instanceof Node)) {
return $this->scope;
Method visitCall
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitCall(Node $node): Context
{
// If this is a call to a method that indicates that we
// are treating the method in scope as a varargs method,
// then set its optional args to something very high so
Method visitBinaryOp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryOp(Node $node): Context
{
$flags = $node->flags;
switch ($flags) {
case flags\BINARY_BOOL_AND:
Method setReturnTypeOfGenerator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function setReturnTypeOfGenerator(FunctionInterface $func, Node $node): void
{
// Currently, there is no way to describe the types passed to
// a Generator in phpdoc.
// So, nothing bothers recording the types beyond \Generator.
Method analyzeDefine
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeDefine(Node $node): void
{
$args = $node->children['args'];
if (\count($args->children) < 2) {
return;
Method analyzeRemainingParametersForVariadic
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeRemainingParametersForVariadic(
CodeBase $code_base,
Context $context,
FunctionInterface $method,
int $start_index,
Method isAssignmentOrNestedAssignmentOrModification
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function isAssignmentOrNestedAssignmentOrModification(Node $node): ?bool
{
$parent_node_list = $this->parent_node_list;
$parent_node = \end($parent_node_list);
if (!$parent_node instanceof Node) {
Method visitUnaryOp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitUnaryOp(Node $node): Context
{
if ($node->flags === flags\UNARY_SILENCE) {
$expr = $node->children['expr'];
if ($expr instanceof Node) {
Method astNodeBinaryop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function astNodeBinaryop(int $flags, PhpParser\Node\Expression\BinaryExpression $n, int $start_line)
{
try {
$left_node = static::phpParserNodeToAstNode($n->leftOperand);
} catch (InvalidNodeException $_) {
Method typeAfterCastToObject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function typeAfterCastToObject(UnionType $expr_type): UnionType
{
static $stdclass;
if ($stdclass === null) {
$stdclass = Type::fromFullyQualifiedString('\stdClass');
Method extractInfoFromReflection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function extractInfoFromReflection(): array
{
$result = [];
$function_names = get_defined_functions();
unset($function_names['user']);