Showing 1,026 of 1,574 total issues
Function finalizeTuplets
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public finalizeTuplets(): void {
// The following line resets the created VF Tuplets and
// created them brand new. Is this needed? And more importantly,
// should the old tuplets be removed manually from the notes?
this.vftuplets = {};
- 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 durations
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public static durations(fraction: Fraction, isTuplet: boolean): string[] {
const durations: string[] = [];
const remainingFraction: Fraction = fraction.clone();
while (remainingFraction.RealValue > 0.0001) { // essentially > 0, but using a small delta to prevent infinite loop
const dur: number = remainingFraction.RealValue;
- 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 checkIfRhythmInstructionsAreSetAndEqual
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private checkIfRhythmInstructionsAreSetAndEqual(instrumentReaders: InstrumentReader[]): void {
const rhythmInstructions: RhythmInstruction[] = [];
for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
if (this.currentMeasure.FirstInstructionsStaffEntries[i]) {
const last: AbstractNotationInstruction = this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions[
- 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 canBeReducedToMultiRest
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public canBeReducedToMultiRest(): boolean {
if (this.firstRepetitionInstructions.length > 0 || this.lastRepetitionInstructions.length > 0) {
return false;
}
let allRestsOrInvisible: boolean = true;
- 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
File formatter.js
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
//
// ## Description
//
// This file implements the formatting and layout algorithms that are used
Function handleVoiceEntry
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
protected handleVoiceEntry(voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
accidentalCalculator: AccidentalCalculator, openLyricWords: LyricWord[],
activeClef: ClefInstruction,
openTuplets: Tuplet[], openBeams: Beam[],
octaveShiftValue: OctaveEnum, staffIndex: number,
- 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 positionNote
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public positionNote(graphicalNote: GraphicalNote): GraphicalNote {
const staffIndex: number =
graphicalNote.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;
if (!(graphicalNote instanceof VexFlowGraphicalNote) || graphicalNote.sourceNote.isRest()
- 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 generateArticulations
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public static generateArticulations(vfnote: VF.StemmableNote, gNote: GraphicalNote,
rules: EngravingRules): void {
if (!vfnote || vfnote.getAttribute("type") === "GhostNote") {
return;
}
- 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 calculateSingleOctaveShift
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
// calculate absolute Timestamp and startStaffLine (and EndStaffLine if needed)
const octaveShift: OctaveShift = multiExpression.OctaveShiftStart;
const startTimeStamp: Fraction = octaveShift.ParentStartMultiExpression.Timestamp;
Function autoBeamNotes
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
private autoBeamNotes(beamedNotes: StemmableNote[]): void {
if (!this.rules.AutoBeamTabs && this.isTabMeasure) { // could also use an option tabBeams to disable beams there completely
return;
}
let autoBeamId: number = 60; // start with 60 to not collide (ids) with xml beams
Function calculateSinglePedal
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected calculateSinglePedal(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
// calculate absolute Timestamp and startStaffLine (and EndStaffLine if needed)
const pedal: Pedal = multiExpression.PedalStart;
const startTimeStamp: Fraction = pedal.ParentStartMultiExpression.Timestamp;
Function drawMusicSystemComponents
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
protected drawMusicSystemComponents(musicSystem: MusicSystem, systemBoundingBoxInPixels: RectangleF2D,
absBoundingRectWithMargin: RectangleF2D): void {
const selectStartSymb: SelectionStartSymbol = this.graphicalMusicSheet.SelectionStartSymbol;
const selectEndSymb: SelectionEndSymbol = this.graphicalMusicSheet.SelectionEndSymbol;
if (this.drawingParameters.drawSelectionStartSymbol) {
- 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 createExpressionFromString
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private createExpressionFromString(prefix: string, stringTrimmed: string,
currentMeasure: SourceMeasure, inSourceMeasureCurrentFraction, inputString: string,
fontStyle: FontStyles,
fontColor: string,
defaultYXml: number = undefined): boolean {
- 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 addOctaveShift
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public addOctaveShift(directionNode: IXmlElement, currentMeasure: SourceMeasure, endTimestamp: Fraction): void {
let octaveStaffNumber: number = 1;
const staffNode: IXmlElement = directionNode.element("staff");
if (staffNode) {
try {
- 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
MusicPartManagerIterator
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
export class MusicPartManagerIterator {
constructor(musicSheet: MusicSheet, startTimestamp?: Fraction, endTimestamp?: Fraction) {
try {
this.frontReached = true;
this.musicSheet = musicSheet;
OpenSheetMusicDisplay
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
export class OpenSheetMusicDisplay {
protected version: string = "1.8.8-dev"; // getter: this.Version
// at release, bump version and change to -release, afterwards to -dev again
/**
Function readChordSymbol
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public static readChordSymbol(xmlNode: IXmlElement, musicSheet: MusicSheet, activeKey: KeyInstruction): ChordSymbolContainer {
const root: IXmlElement = xmlNode.element("root");
const kind: IXmlElement = xmlNode.element("kind");
const kindText: IXmlAttribute = kind.attribute("text");
- 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 addTie
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private addTie(tieNodeList: IXmlElement[], measureStartAbsoluteTimestamp: Fraction, maxTieNoteFraction: Fraction, tieType: TieTypes): void {
if (tieNodeList) {
if (tieNodeList.length === 1) {
const tieNode: IXmlElement = tieNodeList[0];
if (tieNode !== undefined && tieNode.attributes()) {
- 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
File VoiceEntry.ts
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {Fraction} from "../../Common/DataObjects/Fraction";
import {Voice} from "./Voice";
import {SourceStaffEntry} from "./SourceStaffEntry";
import {Note} from "./Note";
import {Pitch} from "../../Common/DataObjects/Pitch";
MusicSystemBuilder
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
export class MusicSystemBuilder {
protected measureList: GraphicalMeasure[][];
protected graphicalMusicSheet: GraphicalMusicSheet;
protected currentSystemParams: SystemBuildParameters;
protected numberOfVisibleStaffLines: number;