Showing 3,272 of 4,939 total issues

Method applyTemporaryFileMappingForParsePhase has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function applyTemporaryFileMappingForParsePhase(CodeBase $code_base, array $temporary_file_mapping_contents): void
    {
        if (count($temporary_file_mapping_contents) === 0) {
            return;
        }
Severity: Minor
Found in src/Phan/Daemon/Request.php - About 1 hr to fix

    Method locateClassConstantCompletion has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function locateClassConstantCompletion(
            CompletionRequest $request,
            CodeBase $code_base,
            Context $context,
            Node $node,
    Severity: Minor
    Found in src/Phan/LanguageServer/CompletionResolver.php - About 1 hr to fix

      Method locateVariableCompletion has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function locateVariableCompletion(
              CompletionRequest $request,
              CodeBase $code_base,
              Context $context,
              string $incomplete_variable_name
      Severity: Minor
      Found in src/Phan/LanguageServer/CompletionResolver.php - About 1 hr to fix

        Method setParentType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        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
        Severity: Minor
        Found in src/Phan/Language/Element/Clazz.php - About 1 hr to fix

          Method getFutureUnionType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getFutureUnionType(): ?UnionType
              {
                  $future_union_type = $this->future_union_type;
                  if ($future_union_type === null) {
                      return null;
          Severity: Minor
          Found in src/Phan/Language/Element/Property.php - About 1 hr to fix

            Method getMarkupDescription has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            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()) {
            Severity: Minor
            Found in src/Phan/Language/Element/Method.php - About 1 hr to fix

              Method createVarForInlineComment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              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;
              Severity: Minor
              Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

                Method analyzeMatchArm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function analyzeMatchArm(
                        Context $child_context,
                        Context $fallthrough_context,
                        ?Closure $match_variable_condition,
                        ?Closure $match_variable_negated_condition,
                Severity: Minor
                Found in src/Phan/BlockAnalysisVisitor.php - About 1 hr to fix

                  Method dumpFileDot has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function dumpFileDot(string $title, array $graph = null): void
                      {
                          if (!$graph) {
                              $graph = $this->fgraph;
                          }
                  Severity: Minor
                  Found in src/Phan/Plugin/Internal/DependencyGraphPlugin.php - About 1 hr to fix

                    Method phan_print_backtrace has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    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();
                    Severity: Minor
                    Found in src/Phan/Bootstrap.php - About 1 hr to fix

                      Method isSimpleExpression has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function isSimpleExpression($arg): bool
                          {
                              if (\is_scalar($arg)) {
                                  return true;
                              }
                      Severity: Minor
                      Found in src/Phan/Plugin/Internal/StringFunctionPlugin.php - About 1 hr to fix

                        Method extractVariables has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function extractVariables($node): array
                            {
                                if (!$node instanceof Node) {
                                    return [];
                                }
                        Severity: Minor
                        Found in src/Phan/Plugin/Internal/LoopVariableReuseVisitor.php - About 1 hr to fix

                          Method afterAnalyzeFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          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");
                          Severity: Minor
                          Found in src/Phan/Plugin/Internal/PhantasmPlugin.php - About 1 hr to fix

                            Method maybeWarnProvidingUnusedParameter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private static function maybeWarnProvidingUnusedParameter(
                                    CodeBase $code_base,
                                    Context $context,
                                    int $lineno,
                                    FunctionInterface $method,
                            Severity: Minor
                            Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                              Method checkAllNamedArgumentsPassed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static function checkAllNamedArgumentsPassed(
                                      CodeBase $code_base,
                                      Context $context,
                                      int $lineno,
                                      FunctionInterface $method,
                              Severity: Minor
                              Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                Method withNonFalseyArrayShapeTypes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                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)) {
                                Severity: Minor
                                Found in src/Phan/Analysis/NegatedConditionVisitor.php - About 1 hr to fix

                                  Method emitInstance has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function emitInstance(
                                          $node,
                                          CodeBase $code_base,
                                          Context $context,
                                          string $issue_name,
                                  Severity: Minor
                                  Found in src/Phan/Analysis/RedundantCondition.php - About 1 hr to fix

                                    Method analyzeBinaryBitwiseOp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function analyzeBinaryBitwiseOp(Node $node): void
                                        {
                                            $left = UnionTypeVisitor::unionTypeFromNode(
                                                $this->code_base,
                                                $this->context,
                                    Severity: Minor
                                    Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix

                                      Method getPrinter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getPrinter(?string $type, OutputInterface $output): IssuePrinterInterface
                                          {
                                              switch ($type) {
                                                  case 'codeclimate':
                                                      $printer = new CodeClimatePrinter();
                                      Severity: Minor
                                      Found in src/Phan/Output/PrinterFactory.php - About 1 hr to fix

                                        Method analyzeBinaryShift has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function analyzeBinaryShift(Node $node): void
                                            {
                                                $left = UnionTypeVisitor::unionTypeFromNode(
                                                    $this->code_base,
                                                    $this->context,
                                        Severity: Minor
                                        Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language