Showing 12 of 20 total issues
Function parseAnnotations
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
parseAnnotations(className, target, comment, annotationsToFind, filePath) {
const ss = new StringScanner(comment)
const annotations = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseSource
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
parseSource(source) {
const metadata = new Metadata()
const ss = new StringScanner(source)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parse
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
parse(reader, annotationsToFind, string) {
const tokens = this.tokenize(string)
let fixedString = ''
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseSource
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
parseSource(source) {
const metadata = new Metadata()
const ss = new StringScanner(source)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parse
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse(reader, annotationsToFind, string) {
const tokens = this.tokenize(string)
let fixedString = ''
Function parseSource
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseSource(source) {
const metadata = new Metadata()
const ss = new StringScanner(source)
Function parseSource
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseSource(source) {
const metadata = new Metadata()
const ss = new StringScanner(source)
Function parseAnnotations
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseAnnotations(className, target, comment, annotationsToFind, filePath) {
const ss = new StringScanner(comment)
const annotations = []
Function parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse(path, mode) {
if (!mode) {
mode = Reader.ES6
}
Function parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
parse(path, mode) {
if (!mode) {
mode = Reader.ES6
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (open === close) {
done = true
}
Consider simplifying this complex logical expression. Open
if ((isArray && part.trim().match(/(.*)=\[/)) ||
(isObject && part.trim().match(/(.*)=\{/)) ||
(isAnnotation && part.trim().match(/(.*)=@(.*)\(/))) {
found = true