mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 02:15:36 +00:00
fix(maintainability): enforce gate and correct loc metric
This commit is contained in:
1 parent
975c864f94
commit
2610971d2e
4 files changed
+9
-4
No files matched your search
@@ -142,7 +142,12 @@ function countLines(content) {
|
||||
if (content.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
return content.split(/\r?\n/).length;
|
||||
|
||||
const lineBreakMatches = content.match(/\r\n|\n|\r/g);
|
||||
const lineBreakCount = lineBreakMatches ? lineBreakMatches.length : 0;
|
||||
const endsWithLineBreak = content.endsWith('\n') || content.endsWith('\r');
|
||||
|
||||
return endsWithLineBreak ? lineBreakCount : lineBreakCount + 1;
|
||||
}
|
||||
|
||||
function countMatches(content, pattern) {
|
||||
|
||||
Reference in new issue
Block a user