Showing 3,272 of 4,939 total issues
Method applyTemporaryFileMappingForParsePhase
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function applyTemporaryFileMappingForParsePhase(CodeBase $code_base, array $temporary_file_mapping_contents): void
{
if (count($temporary_file_mapping_contents) === 0) {
return;
}
Method locateClassConstantCompletion
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function locateClassConstantCompletion(
CompletionRequest $request,
CodeBase $code_base,
Context $context,
Node $node,
Method locateVariableCompletion
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function locateVariableCompletion(
CompletionRequest $request,
CodeBase $code_base,
Context $context,
string $incomplete_variable_name
Method setParentType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setParentType(Type $parent_type, int $lineno = 0): void
{
if ($this->getInternalScope()->hasAnyTemplateType()) {
// Get a reference to the local list of templated
// types. We'll use this to map templated types on the
Method getFutureUnionType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFutureUnionType(): ?UnionType
{
$future_union_type = $this->future_union_type;
if ($future_union_type === null) {
return null;
Method getMarkupDescription
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMarkupDescription(): string
{
$string = '';
// It's an error to have visibility or abstract in an interface's stub (e.g. JsonSerializable)
if ($this->isPrivate()) {
Method createVarForInlineComment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function createVarForInlineComment(CodeBase $code_base, Context $context, string $variable_name, UnionType $type, bool $create_variable): void
{
if (!$context->getScope()->hasVariableWithName($variable_name)) {
if (Variable::isHardcodedVariableInScopeWithName($variable_name, $context->isInGlobalScope())) {
return;
Method analyzeMatchArm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeMatchArm(
Context $child_context,
Context $fallthrough_context,
?Closure $match_variable_condition,
?Closure $match_variable_negated_condition,
Method dumpFileDot
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function dumpFileDot(string $title, array $graph = null): void
{
if (!$graph) {
$graph = $this->fgraph;
}
Method phan_print_backtrace
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function phan_print_backtrace(bool $is_crash = false, int $frames_to_skip = 2): void
{
// Uncomment this if even trying to print the details would crash
/*
ob_start();
Method isSimpleExpression
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function isSimpleExpression($arg): bool
{
if (\is_scalar($arg)) {
return true;
}
Method extractVariables
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function extractVariables($node): array
{
if (!$node instanceof Node) {
return [];
}
Method afterAnalyzeFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function afterAnalyzeFile(CodeBase $code_base, Context $context, string $file_contents, Node $node): void
{
$path = $context->getFile();
if (Paths::isAbsolutePath($path) || \strpos($path, '../') !== false) {
CLI::printToStderr("phantasm: Skipping '$path': Only modifying files within the project directory\n");
Method maybeWarnProvidingUnusedParameter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function maybeWarnProvidingUnusedParameter(
CodeBase $code_base,
Context $context,
int $lineno,
FunctionInterface $method,
Method checkAllNamedArgumentsPassed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function checkAllNamedArgumentsPassed(
CodeBase $code_base,
Context $context,
int $lineno,
FunctionInterface $method,
Method withNonFalseyArrayShapeTypes
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function withNonFalseyArrayShapeTypes(Variable $variable, $dim_node, Context $context, bool $non_nullable): Context
{
$dim_value = $dim_node instanceof Node ? (new ContextNode($this->code_base, $this->context, $dim_node))->getEquivalentPHPScalarValue() : $dim_node;
// TODO: detect and warn about null
if (!\is_scalar($dim_value)) {
Method emitInstance
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function emitInstance(
$node,
CodeBase $code_base,
Context $context,
string $issue_name,
Method analyzeBinaryBitwiseOp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeBinaryBitwiseOp(Node $node): void
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,
Method getPrinter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPrinter(?string $type, OutputInterface $output): IssuePrinterInterface
{
switch ($type) {
case 'codeclimate':
$printer = new CodeClimatePrinter();
Method analyzeBinaryShift
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function analyzeBinaryShift(Node $node): void
{
$left = UnionTypeVisitor::unionTypeFromNode(
$this->code_base,
$this->context,