Source Code Graph for Dependency Resolution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large-scale code bases face inefficiencies in finding qualified names for external dependencies due to the time-consuming nature of conventional systems that search the entire code base for appropriate package, library, or external code references.

Innovation Solution

A distributed system representing a large-scale graph of source code, where a parser identifies simple names and provides corresponding qualified names, and build-system dependencies, allowing for caching and reuse of computations, with enrichment and filtering of results based on usage frequency, visibility, and complexity.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional systems search the entire code base in real-time to find qualified names, then completeness of dependency resolution is improved, but processing time becomes unacceptably long for large-scale code bases

Engineering Contradiction:
Improvecompleteness of dependency resolutionVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary indexing of the entire code base to build a search graph before real-time queries are executed. This pre-processing step stores qualified names, simple names, and dependency relationships in an optimized graph structure, enabling fast retrieval during actual development without scanning the entire code base again.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A search graph data structure serves as an intermediary between the raw code base and the IDE's dependency resolution needs. The graph transforms the complex code base into a queryable structure with nodes representing code elements and edges representing relationships, enabling efficient traversal and lookup operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If standard IDEs process large amounts of source code to find appropriate package and library references, then accuracy of dependency identification is improved, but system resource consumption increases significantly

Engineering Contradiction:
Improveaccuracy of dependency identificationVSAvoidsystem resource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system pre-computes and stores dependency relationships, qualified names, and code element metadata in a search graph during an indexing phase. This eliminates the need for repeated full-code-base analysis during IDE operations, significantly reducing real-time resource consumption while maintaining accurate dependency identification.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system extracts only the necessary information (qualified names, simple names, dependency relationships) from the complete code base and stores it in a compact graph structure. This extracted representation retains all needed information for dependency resolution while consuming minimal memory and processing resources during queries.

Inventive Principle:
Principle #2Taking out (Extraction)

3Quantity of substance

If the system provides comprehensive search results for qualified names, then completeness of candidate selection is improved, but complexity of result processing increases for the user

Engineering Contradiction:
Improvecompleteness of candidate selectionVSAvoidcomplexity of result processing
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The system analyzes usage patterns and frequency data from the code base to automatically rank search results. Qualified names are sorted by relevance based on how frequently they appear in similar contexts, providing feedback-driven prioritization that surfaces the most likely correct matches at the top of results, reducing user effort while maintaining completeness.

Inventive Principle:
Principle #23Feedback

Data Source

PatentEP3320430B1Automatic imports and dependencies in large-scale source code repositories
Publication Date: 2022.05.11 GOOGLE LLC
  • EP3320430B1 patent drawingFigure 1
  • EP3320430B1 patent drawingFigure 2
  • EP3320430B1 patent drawingFigure 3

AI summary

A system and method for finding candidates of qualified names for at least one simple name in a source code file are disclosed. A source code file may be received that has at least one simple name for which a corresponding qualified name is required. The source code file may be parsed to determine the simple names in the file and the qualified names in the file. For the at least one simple name for which a corresponding qualified name is required, a source code graph may be searched to find potential candidate qualified names that correspond to the at least one simple name. Upon receipt of a list of potential candidate qualified names from the source code graph, the list may be outputted to a user in order for the user to choose the appropriate qualified name. Build dependencies also be chosen for the qualified name.