Add Operation Support for Physical Lines of Code (LOC)#65
Open
kilo52 wants to merge 43 commits into
Open
Conversation
Added the rcnCountLinesOfCode() API function to count physical lines of code in provided source text. Added the corresponding options mode in the RcnCountOption enumeration. Added LOC support in scount. Changed test resources for expected output text to include LOC counts. [CL]: Added operation support for physical lines of code (LOC). [Issue#10] Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
This removes duplication. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Made it smaller and easier to understand. Resolved linter error about cognitive complexity. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Added internally used Span typedef and replaced usage of individual variables and function parameters for command marker strings and their corresponding length with a single Span instead. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Moved the Span typedef to the evaluation.h header to make it reusable. Changed the function signatures of getBlockCommentStartString() and getBlockCommentEndString() to return a Span directly instead of a raw pointer. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Needed for NULL definition from stddef. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Added more test functions for various cases. Added test resource file for specific UTF-16 cases with comment lines. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Suppress warnings about magic numbers, this is acceptable in tests. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Replaced the single ptr and end pointers with a Span parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Replaced the single pointer and end parameters with a Span parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Refactored code to check for beginning of comment marker of various types. Makes the code more readable. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Changed the implementation to always work with the segment Span struct directly instead of keeping separate char pointers and length variable. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Refactored internal segmentHasCode() function to call skipSpaceCharacters() for better readability. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Improved readability. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Use explicit member identifiers in designated initializers. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Changed to use Span as parameters instead of single char pointer with separate length parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Changed to use Span as parameters instead of single char pointer with separate length parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Changed to use Span as parameters instead of single char pointer with separate length parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Changed to use Span as parameters instead of single char pointer with separate length parameter. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Improved readability. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Rearranged parameter positions. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Renamed local variable. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Added internal utf16HasCommentMarker() function to check for specific comment text markers. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Replaced block comment start length parameter with block start Span parameter. Rearranged parameter order. Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
rcnCountLinesOfCode()API function to count physical lines of code (classic LOC metric) in provided source text and adds LOC support inscount.