Skip to content

Commit 03361cc

Browse files
aseembits93Saga4
authored andcommitted
todos for next iteration
1 parent 8472368 commit 03361cc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

codeflash/api/aiservice.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,13 @@ def get_optimization_impact(
577577
]
578578
)
579579
code_diff = f"```diff\n{diff_str}\n```"
580+
# TODO get complexity metrics and fn call heuristics -> constructing a complete static call graph can be expensive for really large repos
581+
# grep function name in codebase -> ast parser to get no of calls and no of calls in loop -> radon lib to get complexity metrics -> send as additional context to the AI service
582+
# metric 1 -> call count - how many times the function is called in the codebase
583+
# metric 2 -> loop call count - how many times the function is called in a loop in the codebase
584+
# metric 3 -> presence of decorators like @profile, @cache -> this means the owner of the repo cares about the performance of this function
585+
# metric 4 -> cyclomatic complexity (https://en.wikipedia.org/wiki/Cyclomatic_complexity)
586+
# metric 5 (for future) -> halstead complexity (https://en.wikipedia.org/wiki/Halstead_complexity_measures)
580587
logger.info("!lsp|Computing Optimization Impact…")
581588
payload = {
582589
"code_diff": code_diff,

0 commit comments

Comments
 (0)