Showing 1,024 of 1,572 total issues
Function findLinkedNotes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public findLinkedNotes(linkedNotes: Note[]): void {
for (let idx: number = 0, len: number = this.voiceEntries.length; idx < len; ++idx) {
const voiceEntry: VoiceEntry = this.voiceEntries[idx];
for (let idx2: number = 0, len2: number = voiceEntry.Notes.length; idx2 < len2; ++idx2) {
const note: Note = voiceEntry.Notes[idx2];
- 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 getTupletNoteDurationFromType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private getTupletNoteDurationFromType(xmlNode: IXmlElement): Fraction {
if (xmlNode.element("type")) {
const typeNode: IXmlElement = xmlNode.element("type");
if (typeNode) {
const type: string = typeNode.value;
- 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 getKeyInstruction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getKeyInstruction(staffIndex: number): KeyInstruction {
if (this.FirstInstructionsStaffEntries[staffIndex]) {
const sourceStaffEntry: SourceStaffEntry = this.FirstInstructionsStaffEntries[staffIndex];
for (let idx: number = 0, len: number = sourceStaffEntry.Instructions.length; idx < len; ++idx) {
const abstractNotationInstruction: AbstractNotationInstruction = sourceStaffEntry.Instructions[idx];
- 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 hasOnlyRests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public get hasOnlyRests(): boolean {
for (const voiceEntry of this.voiceEntries) {
for (const note of voiceEntry.Notes) {
if (!note.isRest()) {
return false;
- 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"