Static Analysis Artifact Capture via Build Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Static analysis systems face challenges in accurately capturing source code and associated artifacts without requiring a build environment, leading to incomplete module dependencies and increased onboarding time, especially for users without access to build systems or compilers.
Innovation Solution
The system automatically captures source code and artifacts by determining the current project state, inferring build commands, and using both build-capture and buildless-capture methods based on module types and definition files, allowing for tree-based graph representations without the need for a build environment.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If build-capture method is used to translate source code into tree-based graph representations, then manufacturing precision of static analysis is improved, but device complexity increases due to requiring build environment, compilers, and build systems
Solution Approach 1:
The system segments the capture process into two distinct methods: build-capture for compiled languages (C, C++, C#, Java) that require build environments, and buildless-capture for interpreted languages (JavaScript, Python, Go) that do not. This segmentation allows the system to apply the appropriate method based on module type, reducing unnecessary complexity while maintaining fidelity where needed.
Solution Approach 2:
The system changes the parameter of capture method selection based on module type identification. By detecting whether a module is compiled or interpreted language type, the system dynamically adjusts the capture approach, using build-capture only when necessary for compiled languages and buildless-capture for interpreted languages, thereby reducing overall system complexity.
2Manufacturing precision
If build-capture method is used for all modules, then manufacturing precision of static analysis is improved, but loss of time increases due to requiring build environment setup and compilation process
Solution Approach 1:
The system segments modules by language type and applies different capture methods accordingly. Interpreted language modules use buildless-capture for immediate translation without compilation, while compiled language modules use build-capture. This segmentation eliminates unnecessary compilation steps for interpreted languages, significantly reducing onboarding time.
Solution Approach 2:
The system applies build-capture only partially - specifically to compiled language modules that require it - rather than universally to all modules. This partial application of the build process reduces overall onboarding time while maintaining fidelity where actually needed.
3Ease of operation
If buildless-capture method is used for interpreted languages, then ease of operation is improved by eliminating build environment requirements, but manufacturing precision may be compromised without proper module dependency tracking
Solution Approach 1:
The system performs preliminary action by identifying and tracking module dependencies before executing buildless-capture. By pre-establishing the dependency graph and determining capture sequences, the system ensures that all required modules are captured in the correct order, maintaining accuracy without requiring build environments.
Solution Approach 2:
The system uses feedback mechanisms to track capture status of individual files and modules. By monitoring which modules have been captured and their dependencies, the system can adjust the capture process dynamically, ensuring completeness and accuracy even when using the simplified buildless-capture method.
4Ease of operation
If automatic capture process is implemented without build environment, then ease of operation is improved, but loss of information increases due to incomplete module dependencies
Solution Approach 1:
The system performs preliminary dependency analysis by scanning module definition files (such as package.json for JavaScript or requirements.txt for Python) to automatically identify and track module dependencies before capture. This preliminary action ensures complete dependency information is gathered without requiring users to manually configure build environments.
Solution Approach 2:
The system implements self-service by automatically detecting module types, inferring build commands when needed, and tracking dependencies without user intervention. The capture process autonomously determines the appropriate method (build-capture or buildless-capture) and executes accordingly, eliminating the need for users to understand or configure complex build systems.
Data Source
AI summary
This disclosure describes a system and method of automatically capturing source code and associated artifacts for static analysis. A method includes receiving a current state of a project that includes a set of files in a directory to be captured for analysis and a current capture status of individual files of the set of files, determining a plan including a sequence of actions in response to the current state of the project, and executing the sequence of actions to capture each of the set of files. The sequence of actions includes capturing buildable modules in the set of files with a build-capture based on a default build command and a buildless-capture based on module definition files.


