Replies: 2 comments 2 replies
-
The way I see it working is as an option, as an opt in feature as I suspect that it would otherwise slow the tool down. Users can then select to flip into this mode getting better calculations where there is a language that supports it. Ideally with the ability for more parsers to be built into scc over time growing its footprint. What you have suggested above however looks about right, as you could add some new definitions into the languages.json to deal with this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your email. A ticket is perfect! I agree that an opt-in is the right approach, if for no other reason than preserving backwards compatability in the output. Can we agree on the schema changes before I start? I want to make sure you don't have a better idea before I start. If you prefer, we can use json-schema. ABC needs to recognize and tally three categories of logic: (1) assignment; (2) branches; and (3) conditionals.
This change minimizes structural changes, as opposed to -- say -- making each keyword a struct of its own. However, it does embed ABC metrics metadata into the structure, which is simple, but dangerous. Internally, I'd probably flatten this back out to the original data structure, and build a separate map for the metric categories that is only used by the ABC code; this would minimize changes and have a one-time startup cost, leaving the performance (hopefully) flat. This may require separating the marshalling structure from the processing structure. The biggest problem I forsee is that the branch rules are less simple than token recognition. For example, for C the rule is that a branch is any function call, or goto at a deeper level of nesting than the goto. So For the UI, ABC can report on different scopes and the user would need to choose from them. ABC is nominally a vector of the three categories, and commonly a scalar (summary) score is calculated. These scores are reported per function or package, or for the entire project. A flag to enable the metric could take |
Beta Was this translation helpful? Give feedback.
-
Discussion point for ABC metrics
Beta Was this translation helpful? Give feedback.
All reactions