Showing 3,272 of 4,939 total issues

Method functionMatchesSignature has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function functionMatchesSignature(
        CodeBase $code_base,
        FunctionInterface $function
    ): float {
        // TODO: Account for visibility
Severity: Minor
Found in src/Phan/Plugin/Internal/MethodSearcherPlugin.php - About 1 hr to fix

    Method findStringsBeginningWith has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function findStringsBeginningWith(string $name): array
        {
            $name = \strtolower($name);
            $name_len = strlen($name);
            $start = 0;
    Severity: Minor
    Found in src/Phan/Library/StringSuggester.php - About 1 hr to fix

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

        Method getPregMatchUnionType has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getPregMatchUnionType(
                CodeBase $code_base,
                Context $context,
                array $argument_list
            ): UnionType {
        Severity: Minor
        Found in src/Phan/Analysis/RegexAnalyzer.php - About 1 hr to fix

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

            Method inheritPHPDoc has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function inheritPHPDoc(
                    CodeBase $code_base,
                    Method $method,
                    Method $o_method
                ): void {
            Severity: Minor
            Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 1 hr to fix

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

                Method parseCodeHandlingDeprecation has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                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,
                Severity: Minor
                Found in src/Phan/AST/Parser.php - About 1 hr to fix

                  Method analyzeFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function analyzeFile(
                          CodeBase $code_base,
                          string $file_path,
                          ?Request $request,
                          string $override_contents = null
                  Severity: Minor
                  Found in src/Phan/Analysis.php - About 1 hr to fix

                    Method updateSignature has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    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)) {
                    Severity: Minor
                    Found in internal/lib/IncompatibleSignatureDetectorBase.php - About 1 hr to fix

                      Method getMethodsForClassName has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      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;
                      Severity: Minor
                      Found in internal/lib/IncompatibleXMLSignatureDetector.php - About 1 hr to fix

                        Method locateMiscellaneousTokenCompletion has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Method canCastToNonNullableType has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function canCastToNonNullableType(Type $type): bool
                              {
                                  if ($type instanceof ScalarType) {
                                      switch ($type::NAME) {
                                          case 'int':
                          Severity: Minor
                          Found in src/Phan/Language/Type/NonZeroIntType.php - About 1 hr to fix

                            Method withFlattenedTopLevelArrayShapeTypeInstancesForSet has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private static function withFlattenedTopLevelArrayShapeTypeInstancesForSet(array $type_set): array
                                {
                                    $result = [];
                                    $has_other_array_type = false;
                                    $empty_array_shape_type = null;
                            Severity: Minor
                            Found in src/Phan/Language/UnionType.php - About 1 hr to fix

                              Method canCastToNonNullableType has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function canCastToNonNullableType(Type $type): bool
                                  {
                                      if ($type instanceof ScalarType) {
                                          switch ($type::NAME) {
                                              case 'string':
                              Severity: Minor
                              Found in src/Phan/Language/Type/LiteralStringType.php - About 1 hr to fix

                                Method nodeToString has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function nodeToString(
                                        $node,
                                        $name = null,
                                        int $indent = 0
                                    ): string {
                                Severity: Minor
                                Found in src/Phan/Debug.php - About 1 hr to fix

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

                                    Method updateTargetPropWithType has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function updateTargetPropWithType(Node $assign_op_node, Closure $get_type): Context
                                        {
                                            $node = $assign_op_node->children['var'];
                                            if (!($node instanceof Node)) {
                                                $this->emitIssue(
                                    Severity: Minor
                                    Found in src/Phan/Analysis/AssignOperatorAnalysisVisitor.php - About 1 hr to fix

                                      Method visitCall has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function visitCall(Node $node): Context
                                          {
                                              $raw_function_name = self::getFunctionName($node);
                                              if (!\is_string($raw_function_name)) {
                                                  return $this->context;
                                      Severity: Minor
                                      Found in src/Phan/Analysis/NegatedConditionVisitor.php - About 1 hr to fix

                                        Method getTypeOfNumericArithmeticOp has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

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