Showing 3,272 of 4,939 total issues
Method functionMatchesSignature
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function functionMatchesSignature(
CodeBase $code_base,
FunctionInterface $function
): float {
// TODO: Account for visibility
Method findStringsBeginningWith
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function findStringsBeginningWith(string $name): array
{
$name = \strtolower($name);
$name_len = strlen($name);
$start = 0;
Method combineTypesAfterWeakEqualityCheck
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function combineTypesAfterWeakEqualityCheck(UnionType $old_union_type, UnionType $new_union_type): UnionType
{
// TODO: Be more precise about these checks - e.g. forbid anything such as stdClass == false in the new type
if (!$old_union_type->hasRealTypeSet()) {
// This is a weak check of equality. We aren't sure of the real types
Method getPregMatchUnionType
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getPregMatchUnionType(
CodeBase $code_base,
Context $context,
array $argument_list
): UnionType {
Method visitBinaryOp
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitBinaryOp(Node $node): Context
{
$flags = $node->flags;
if ($this->isInNoOpPosition($node)) {
if (\in_array($flags, [flags\BINARY_BOOL_AND, flags\BINARY_BOOL_OR, flags\BINARY_COALESCE], true)) {
Method inheritPHPDoc
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function inheritPHPDoc(
CodeBase $code_base,
Method $method,
Method $o_method
): void {
Method getReturnTypesOfArray
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getReturnTypesOfArray(Context $context, Node $node): \Generator
{
if (\count($node->children) === 0) {
// Possibly unreachable (array shape would be returned instead)
yield $node->lineno => [MixedType::instance(false)->asPHPDocUnionType(), $node];
Method parseCodeHandlingDeprecation
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function parseCodeHandlingDeprecation(CodeBase $code_base, Context $context, string $file_contents, string $file_path): Node
{
global $__no_echo_phan_errors;
// Suppress errors such as "declare(encoding=...) ignored because Zend multibyte feature is turned off by settings" (#1076)
// E_COMPILE_WARNING can't be caught by a PHP error handler,
Method analyzeFile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function analyzeFile(
CodeBase $code_base,
string $file_path,
?Request $request,
string $override_contents = null
Method updateSignature
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function updateSignature(string $function_like_name, array $arguments_from_phan): array
{
$return_type = $arguments_from_phan[0];
$arguments_from_svn = $this->parseFunctionLikeSignature($function_like_name);
if (is_null($arguments_from_svn)) {
Method getMethodsForClassName
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMethodsForClassName(string $class_name): ?array
{
$class_name_lc = strtolower($class_name);
$class_name_file_map = $this->getFoldersForClassNameList();
$class_name_files = $class_name_file_map[$class_name_lc] ?? null;
Method locateMiscellaneousTokenCompletion
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function locateMiscellaneousTokenCompletion(
CompletionRequest $request,
CodeBase $code_base,
Context $context,
Node $node,
Method canCastToNonNullableType
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function canCastToNonNullableType(Type $type): bool
{
if ($type instanceof ScalarType) {
switch ($type::NAME) {
case 'int':
Method withFlattenedTopLevelArrayShapeTypeInstancesForSet
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function withFlattenedTopLevelArrayShapeTypeInstancesForSet(array $type_set): array
{
$result = [];
$has_other_array_type = false;
$empty_array_shape_type = null;
Method canCastToNonNullableType
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function canCastToNonNullableType(Type $type): bool
{
if ($type instanceof ScalarType) {
switch ($type::NAME) {
case 'string':
Method nodeToString
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function nodeToString(
$node,
$name = null,
int $indent = 0
): string {
Method generateEntrySnippetForSetting
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function generateEntrySnippetForSetting(string $setting_name, $setting_value, array $additional_comment_lines): string
{
$source = self::generateCommentForSetting($setting_name);
foreach ($additional_comment_lines as $line) {
$source .= " // $line\n";
Method updateTargetPropWithType
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function updateTargetPropWithType(Node $assign_op_node, Closure $get_type): Context
{
$node = $assign_op_node->children['var'];
if (!($node instanceof Node)) {
$this->emitIssue(
Method visitCall
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitCall(Node $node): Context
{
$raw_function_name = self::getFunctionName($node);
if (!\is_string($raw_function_name)) {
return $this->context;
Method getTypeOfNumericArithmeticOp
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getTypeOfNumericArithmeticOp(Node $node): UnionType
{
$code_base = $this->code_base;
$context = $this->context;
$left = UnionTypeVisitor::unionTypeFromNode(