Showing 3,272 of 4,939 total issues
Method emitSignatureRealMismatchIssue
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function emitSignatureRealMismatchIssue(
CodeBase $code_base,
Method $method,
Method $o_method,
string $issue_type,
Method compareYieldFromAgainstDeclaredType
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function compareYieldFromAgainstDeclaredType(Node $node, FunctionInterface $method, Context $context, array $template_type_list, UnionType $yield_from_type): Context
{
$code_base = $this->code_base;
$type_list_count = \count($template_type_list);
Method buildUses
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function buildUses(Node $n): void
{
switch ($n->kind) {
case ast\AST_VAR:
$name = $n->children['name'];
Method classListFromClassNameNode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function classListFromClassNameNode(CodeBase $code_base, Context $context, $node): array
{
$results = [];
$strings = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $node)->asStringScalarValues();
foreach ($strings as $string) {
Method getFunctionFromNode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFunctionFromNode(bool $return_placeholder_for_undefined = false): iterable
{
$expression = $this->node;
if (!($expression instanceof Node)) {
if (!\is_string($expression)) {
Method main
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function main(): void
{
Shim::load();
global $argv;
if (count($argv) !== 2) {
Method getAnalyzeFunctionCallClosures
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array
{
/**
* @return Closure(CodeBase,Context,Func,array):void
*/
Method analyzePattern
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzePattern(CodeBase $code_base, Context $context, Func $function, string $pattern): void
{
/**
* @suppress PhanParamSuspiciousOrder 100% deliberate use of varying regex and constant $subject for preg_match
* @return ?array<string,mixed>
Method warnAboutTransientSleepProperties
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function warnAboutTransientSleepProperties(array $sleep_properties): void
{
if (count($sleep_properties) === 0) {
// Give up, failed to extract property names
return;
Method analyzeFunctionLike
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function analyzeFunctionLike(CodeBase $code_base, FunctionInterface $method): void
{
if (Phan::isExcludedAnalysisFile($method->getContext()->getFile())) {
// This has no side effects, so we can skip files that don't need to be analyzed
return;
Method nodeCanBeStatic
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function nodeCanBeStatic(CodeBase $code_base, FunctionInterface $method, $node): bool
{
if (!($node instanceof Node)) {
if (is_array($node)) {
foreach ($node as $child_node) {
Method afterAnalyzeFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function afterAnalyzeFile(
CodeBase $code_base,
Context $context,
string $file_contents,
Node $node
Method importMixin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function importMixin(CodeBase $code_base, Type $type): void
{
$fqsen = FullyQualifiedClassName::fromType($type);
if (!$code_base->hasClassWithFQSEN($fqsen) || $fqsen === $this->fqsen) {
Issue::maybeEmit(
Method importAncestorClasses
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function importAncestorClasses(CodeBase $code_base): void
{
if (!$this->isFirstExecution(__METHOD__)) {
return;
}
Method getCommentParamAssertionClosure
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getCommentParamAssertionClosure(CodeBase $code_base): ?Closure
{
if (!\is_object($this->comment)) {
return null;
}
Method visitMethodCall
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitMethodCall(Node $node): void
{
[$parent, $used] = $this->findNonUnaryParentNode($node);
if (!$parent) {
//fwrite(STDERR, "No parent in " . __METHOD__ . "\n");
Method printGraph
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function printGraph(array $graph): void
{
foreach ($graph as $k => $v) {
echo "$k\n";
foreach ($v as $kk => $vv) {
Method readMessages
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function readMessages(): void
{
if ($this->eof) {
return;
}
Method visitEmpty
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitEmpty(Node $node): Context
{
$context = $this->context;
$var_node = $node->children['expr'];
if (!($var_node instanceof Node)) {
Method visitClass
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function visitClass(Node $node): Context
{
if ($node->flags & ast\flags\CLASS_ANONYMOUS) {
$class_name =
(new ContextNode(