Source Code Search Ranking by Reference Popularity
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Developers face the challenge of manually sorting through a large number of results when searching for symbol definitions in large code bases, as existing text editor applications do not efficiently rank files based on relevance.
Innovation Solution
A method is introduced that derives a score for each file based on the quantity of references within the source code of other files, allowing for the ranking of matching files upon a query, with optional consideration of context to prioritize results.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If developers search for symbol definitions in large code bases using existing text editor applications, then the search function can locate symbol definitions, but the number of results returned becomes very large requiring manual sorting
Solution Approach 1:
The patent changes the parameter of result presentation from unranked to ranked by deriving a popularity score for each file. This score is calculated based on the quantity of references to each file in the source code, transforming the search results into a ranked list that prioritizes more relevant files.
Solution Approach 2:
The patent introduces an intermediary ranking mechanism that acts as a mediator between the search query and the results. This intermediary computes a popularity score based on reference quantities and uses it to rank files, thereby reducing the need for manual sorting by developers.
2Adaptability or versatility
If the code base grows in size, then more symbols and definitions are available, but the number of results for a given query increases requiring increasingly more manual sorting time
Solution Approach 1:
The patent performs preliminary action by pre-computing popularity scores for all files in the code base based on their reference quantities. This pre-computed ranking information is stored and reused when search queries are executed, allowing the system to handle growing code bases efficiently without increasing manual sorting time for each query.
Solution Approach 2:
The patent introduces a new parameter (popularity score derived from reference quantity) that enables the system to adapt to growing code bases. By ranking results based on this parameter, the system maintains search efficiency even as the code base expands and the number of potential results increases.
3Reliability
If all matching files are returned for a symbol definition query, then complete results are provided, but developers must manually sort through each result to select the appropriate definition
Solution Approach 1:
The patent changes the presentation parameter from a flat list of matching files to a ranked list ordered by popularity score. This transformation maintains result completeness (all matching files are still returned) while significantly improving ease of operation by presenting the most relevant files first based on their reference quantities.
Solution Approach 2:
The patent segments the results into a ranked hierarchy based on popularity scores. Files are segmented into different levels of relevance, with highly referenced files appearing first and less referenced files appearing later, allowing developers to quickly find appropriate definitions without sorting through the entire list.
Data Source
AI summary
Methods, systems, and apparatus, including computer program products are provided for indexing tags in source code. Implementations provide an enhanced retrieval of source code, in which a score for each of a plurality of files is derived based on a quantity of references to each file in source code of the remaining plurality of files. A query is received identifying a source code tag. Matching files of the plurality of files that satisfy the query are identified, a ranking of the matching files is generated based on the derived scores, and the ranking is provided.


