Added-value reports
Walk through the added-value reports available in Codee.
Getting ready
In this guide we are assuming that you have followed one of the Fortran or
C/C++ basic workflow guides and that you were able to generate the
compile_commands.json
file.
Added-value reports
Now we will review the different reports that Codee generates besides the checks report.
Screening with Ranking
The screening report details which recommendations of the Open Catalog are applicable to the code, and ranks them based on their estimated positive impact to help prioritize the refactoring efforts:
codee screening -p build/compile_commands.json
SCREENING REPORT
---Number of files---
Total | C C++ Fortran
----- | - --- -------
1 | 0 0 1
RANKING OF QUALITY CHECKERS
Checker Category Priority AutoFixes # Title
------- ----------------------------- -------- --------- -- ---------------------------------------------------------------------------------------
PWR063 correctness, modern, security P12 (L1) 1 Avoid using legacy Fortran constructs
PWR068 correctness, modern, security P9 (L2) 5 Encapsulate procedures within modules to avoid the risks of calling implicit interfaces
PWR069 correctness, modern, security P6 (L2) 6 6 Use the keyword only to explicitly state what to import from a module
PWR001 correctness, modern, security P1 (L3) 5 Declare global variables as function parameters
------- ----------------------------- -------- --------- -- ---------------------------------------------------------------------------------------
Total 6 17
SUGGESTIONS
Use 'roi' to get a return of investment estimation report:
codee roi -- gfortran -c himeno.f90
Use 'checks' to find out details about the detected checks:
codee checks -- gfortran -c himeno.f90
1 file, 7 functions, 5 loops, 214 LOCs successfully analyzed (17 checkers) and 0 non-analyzed files in 285 ms
Technical Debt
This report quantifies as a single number, the technical debt score, all code refactors that are necessary to leverage all improvement opportunities identified by Codee. Over time, your goal should be to progressively reduce this score to zero:
codee technical-debt -p build/compile_commands.json
TECHNICAL DEBT REPORT
This report quantifies the technical debt associated with the modernization of legacy code by assessing the extent of refactoring required for language constructs. The score is determined based on the number of language constructs necessitating refactoring to bring the source code up to modern standards. Additionally, the metric identifies the impacted source code segments, detailing affected files, functions, and loops.
Score Affected files Affected functions Affected loops
----- -------------- ------------------ --------------
17 1 6 0
TECHNICAL DEBT BREAKDOWN
Lines of code Analysis time Checkers Technical debt score
------------- ------------- -------- --------------------
214 124 ms 17 17
The listing of language constructs associated with legacy code found in the source code is as follows:
- PAUSE
SUGGESTIONS
Use 'screening' to find out details about the detected checks:
codee screening -p build/compile_commands.json
1 file, 7 functions, 5 loops, 214 LOCs successfully analyzed (17 checkers) and 0 non-analyzed files in 126 ms
Compiler Efficiency Report
Codee provides the Compiler Efficiency Report (codee diagnose --compiler-efficiency
) for comparing the different optimizations that the
compiler performs when changing from the current build settings to the
optimizations flags suggested by Codee. In a nutshell, it allows the user to
compare the compiler optimizations performed under the current -OX
flag with
the results using the optimization flag suggested by Codee. E.g: -O2
vs
-O3
.
codee diagnose -p build/compile_commands.json --compiler-efficiency
Note: the compilation database entries will be analyzed in the order necessary to meet module dependencies between Fortran source files.
Configuration file 'compile_commands.json' successfully parsed.
Date: 2025-04-15 Codee version: 2025.2 License type: Full
Performing Fortran module dependency analysis... Done
[1/1] himeno.f90 ... Done
COMPILER EFFICIENCY REPORT
Compiler: gfortran-13.3
Optimization flags detected in the build: -O3
Maximum optimization flags suggested by Codee: -ftree-vectorize -O3
Loop Current Suggested Codee optimizations
------------------------- --------- --------- -------------------
himeno.f90
|- initmt:247:3 no (outr) no (outr)
`- jacobi:291:3 no (outr) no (outr)
`- jacobi:293:6 no (outr) no (outr) PWR035(1)
`- jacobi:294:9 no (ctrl) no (ctrl) PWR035(1)
`- jacobi:295:12 auto auto PWR054(1)
SUMMARY
Vectorized Current Suggested
---------- ------- ---------
auto 1 1
no 4 4
n/a 0 0
---------- ------- ---------
Total number of loops: 5
LEGEND
Current: Compiler optimization report with the optimization level used on the build
Suggested: Compiler optimization report with the optimization level suggested by Codee
Codee optimizations: list of Codee checkers reported for each loop
auto: loop automatically vectorized by the compiler
no: loop not vectorized by the compiler. Could happen for different reasons:
no (cost): the compiler's cost model recommends so
no (ctrl): complex control flow inhibits vectorization
no (dep) : there is (or seems to be) a dependency inhibiting vectorization
no (prec): potential precision loss if vectorized
no (vgen): SIMD instruction generator not supported by the compiler
no (outr): unsupported outer loop
no (unrl): the loop was fully unrolled by the compiler
no (call): the loop was replaced by a library call
no (othr): any other reason
n/a: no information was provided by the compiler for this loop
SUGGESTIONS
Use --show-messages to get details on the messages reported by each compiler:
codee diagnose --show-messages -p compile_commands.json --compiler-efficiency
Find out the actionable insights related to vectorization:
codee checks --only-categories vector --verbose -p compile_commands.json
1 file, 7 functions, 5 loops, 214 LOCs successfully analyzed (25 checkers) and 0 non-analyzed files in 1158 ms
ROI
Once we have an overview of all the identified improvement opportunities, the ROI report estimates the effort and time savings realized through the automated analysis that Codee has just performed. The estimation compares the time that would have been needed to manually evaluate each part of the code analyzed against every rule in the Open Catalog to identify the improvement opportunities:
codee roi -p build/compile_commands.json
ROI ANALYSIS SUMMARY
This analysis underscores the tangible benefits Codee brings to the development process, not only in terms of savings in development effort, but also in realizing significant cost efficiencies for the organization.
Impact on Development Effort:
This report identifies critical areas within the source code that necessitate attention from the development team, and forecasts a significant reduction in workload by an estimated 60 hours.
Without Codee | With Codee | Hours saved
------------- | ---------- | -----------
140 hours | 17 hours | 123 hours
Impact on Cost Savings:
Considering a standard developer's workload of approximately 1800 hours/year, Codee's intervention translates to saving an equivalent to 0.03 (60h / 1800h) developers working full-time. Assuming an average cost of a developer for the company (salary + associated costs) of €100,000, this amounts to cost savings of €3,333 (€100,000 x 0.03).
Developer hours/year | Number of devs. saved/year | Developer salary/year | Total costs saved/year
-------------------- | -------------------------- | --------------------- | ----------------------
1800 hours | 0.07 | €100,000 | €6,833
SUGGESTIONS
Set custom parameters for the ROI calculation, using --dev-cost-per-year, --dev-hours-per-year, and --checker-effort flags; e.g.:
codee roi --dev-cost-per-year 20000 --dev-hours-per-year 1600 --checker-effort 1.5 -p build/compile_commands.json
Use --check-id <list of checkers separated by comma> to calculate the ROI for an arbitrary subset of checkers to enable; e.g.:
codee roi --check-id PWR030,PWR039 -p build/compile_commands.json
1 file, 7 functions, 5 loops, 214 LOCs successfully analyzed (18 checkers) and 0 non-analyzed files in 222 ms
ROI ANALYSIS SUMMARY
This analysis underscores the tangible benefits Codee brings to the development process, not only in terms of savings in development effort, but also in realizing significant cost efficiencies for the organization.