New Importer: IndentationLevelImporter
See original GitHub issueFeature request
Description
Create an importer that counts the indentation level of each line and generates an cc.json output with attributes like this:
{
"il1+" : 1,
"il2+" : 3
}
where il1 is the number of lines in the file with indentation level 1 or higher.
The indentation level is calculated by
(positionOfTheFirstCharacterInLine / tabWidth) + (positionOfTheFirstCharacterInLine % tabWidth == 0 ? 0 : 1)
The tabWidth needs to be estimated before.
The importer should be executable with:
ccsh indentationlevelimporter FOLDER/FILE -p PROJECT_NAME -o OUPUT.CC.JSON
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
Set Excel import hierarchy with indentation
Set Excel import hierarchy with indentation ... Decide which cells you want to be parent topics, then select the cells below the parent...
Read more >Evernote importer doesnt recognise bullet list indent levels
I imported notes from evernote. In most of my notes that I checked, all bullet lists indent levels are moved to the first...
Read more >Tips for New Importers and Exporters
To assist you, we offer the following tips for new importers and ... Fill levels for agricultural quotas and textiles eligible for trade ......
Read more >PEP 8 – Style Guide for Python Code
Use 4 spaces per indentation level. Continuation lines should align wrapped elements either vertically using Python's implicit line joining ...
Read more >Problem with indent when i import from excel to project
Hi, I'm trying import my project from excel to MSP but i have a problem with indent. Just when the data is importing,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would suggest implementing it like the SCMLogParser, in other words all metrics are calculated by the same filter and thus the share nothing principle will not be violated. The potential drawback is, that there may be (too) many command line arguments (… that is if we make the metrics customizable (i.e. max indentation level, predetermined tab width, …). if we just hard-code/guess the parameters as done in the SCMLogParser the interface stays clean. It is a trade-off i guess)
Good question, I asked myself the same and have found no good answer yet.
The architectures are indeed very similar, and a combination technically possible. However I don’t know if this is conceptually desirable, since they do kinda different things; the (sonar) sourceCodeParser gets base metrics for certain languages (currently java only) while this thing here provides some special metrics for any file scanned (that may or may not be meaningful). I don’t know if the use case for this and the (sonar) sourceCodeParser are similar enough to fuse them together. Also the CLI options of a fused importer may get confusing.
The metrics we are obtaining with the new Parser cannot be obtained by Sonar Directly, the only thing it does is computing the maximum nesting level (we created a custom metric for that). It would be possible to generate a custom metric for the sonar plugins that provides the same information as the indentation level parser does, however they would be only applicable to certain programming languages (i.e. Java only at this point)