Multi-Level Code Classification for Reliable Quality Indicators
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code classification methods fail to accurately and reliably identify portions of code that require the most development or maintenance efforts, particularly in large and dynamically changing code bases, leading to inefficient resource allocation and potential oversight of critical improvement areas.
Innovation Solution
A computer-implemented method for code classification that evaluates code structure characteristics on multiple levels, determines violations of level-specific conditions, and generates a weighted code quality indicator by combining these violations to guide development and maintenance efforts.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If existing code classification methods are used, then code quality can be assessed, but the identification of code portions needing development/maintenance efforts is inaccurate and unreliable
Solution Approach 1:
The patent segments code quality evaluation into multiple independent code structure levels (e.g., file level, function level, method level, class level). Each level has specific conditions that are evaluated separately, and violations are aggregated to produce the final code quality indicator. This segmentation allows for more precise and reliable identification of code portions needing improvement by considering context at different hierarchical levels.
2Quantity of substance
If code analysis is performed on large and dynamically changing code bases, then comprehensive code quality assessment is possible, but the process becomes cumbersome and time-consuming
Solution Approach 1:
The patent performs preliminary parsing of the source code to obtain code structure characteristics before evaluation. By pre-processing the code base to extract and store structural information (such as nesting depth, number of execution paths, lines of code), the system can quickly assess code quality without re-analyzing the entire code base from scratch, thus reducing time consumption for large and dynamically changing code bases.
3Productivity
If existing code evaluation approaches are used, then code quality can be measured, but development/maintenance efforts are not efficiently concentrated on the most needed portions
Solution Approach 1:
The patent generates a code quality indicator that provides feedback about the current state of code portions. By evaluating code structure characteristics against predefined conditions and calculating violation weights, the system produces actionable feedback that guides developers and maintainers to prioritize specific code portions. This feedback mechanism enables efficient concentration of development/maintenance efforts on areas with the highest quality indicators.
Data Source
Figure 1~2
Figure 3~5
AI summary
A computer-implemented method for code classification is disclosed. The method comprises parsing source code stored on a code carrier to obtain a plurality of code structure characteristics of the source code, and evaluating the code structure characteristics on at least three code structure levels. In some embodiments, the at least three code structure levels comprise one or more of: a global level, a module level, an intermodule level, a function level, an inter-function level, and an implementation level. The evaluation on each code structure level comprises, for each of one or more level-specific conditions, determining whether the code structure characteristics violate the level-specific condition, and (when the level-specific condition is violated) representing the violation by a weighted value. The method also comprises combining the weighted values for at least some of the violated level- specific conditions over the at least three code structure levels to generate one or more code quality indicator for the source code. Corresponding computer program product, apparatus, and system are also disclosed.