Showing 168 of 286 total issues
Method _countNoteValues
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _countNoteValues($xml){
$notes = $xml->xpath("//note");
$notesArray = array(
(object)array("label" => "B", "value" => 0 ),
Function renderNotes
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderNotes = function(measures, canvas, renderer, context, stave, pattern) {
// clear canvas
context.clearRect(0, 0, canvas.width, canvas.height);
Function generateVexflowNotes
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateVexflowNotes = function(score, result) {
var measures = [];
for (var i = 0; i < score.measures.length; i++) {
for (var j = 0; j < score.measures[i].notes.length; j++) {
Function playResult
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
playResult = function(){
var notesToBePlayed = [];
//get notes of current extract:
var currentResultNotes = JSON.parse($('#extract-carousel').find('div.carousel-inner').find('div.item.active').find('.resultExtract').val());
File ScoreView.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @constructor */
MusicXMLAnalyzer.ScoreView = function(){
var that = {},
Function renderNotes
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderNotes = function(measures, canvas, renderer, context, stave, score) {
// clear canvas
context.clearRect(0, 0, canvas.width, canvas.height);
Function checkHorizontalArea
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkHorizontalArea = function(y) {
if (y > spaceBetweenLines * 1.25 && y <= spaceBetweenLines * 1.75) {
hoveredNote = "b";
hoveredOctave = "6";
Function PatternView
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
MusicXMLAnalyzer.PatternView = function(){
var that = {},
$modeButtonClass = $(".btn-mode"),
- 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 playPattern
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
playPattern = function() {
var notesToBePlayed = [];
//get notes of current extract:
var currentPatternNotes = patternModel.getAllNoteElements();
Function playScore
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
playScore = function() {
var notesToBePlayed = [];
//get notes of current score part:
// var currentPatternNotes = patternModel.getAllNoteElements();
Function _generateCSV
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function _generateCSV($user) {
// csv variables
$seperator = ';';
$stringClosing = '"';
- 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 initIntervalDistribution
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
initIntervalDistribution = function(data) {
$('#bar_intervalDistribution').empty();
var containerWidth = $('#bar_intervalDistribution').width() - 30;
var margin ={ top:20, right:30, bottom:130, left: 40 },
width = containerWidth - margin.left - margin.right,
Function initNoteDistribution
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
initNoteDistribution = function(data) {
$('#bar_noteDistribution').empty();
var containerWidth = $('#bar_noteDistribution').width() - 30;
var margin ={ top:20, right:30, bottom:50, left: 40 },
width = containerWidth - margin.left - margin.right,
Method _generateCSV
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _generateCSV($user) {
// csv variables
$seperator = ';';
$stringClosing = '"';
Function renderVexFlowNotePreview
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderVexFlowNotePreview = function() {
// delete canvas
context.clearRect(0, 0, canvas.width, canvas.height);
stave.setContext(context).draw();
Function search
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function search($pattern) {
$p = $pattern[0]->notes;
self::$patternArray = array();
self::$results = array();
- 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 search
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function search($pattern) {
$p = $pattern[0]->notes;
self::$patternArray = array();
self::$results = array();
- 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 DashboardModel.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @constructor */
MusicXMLAnalyzer.DashboardModel = function(){
var that = {},
Function getVexflowDuration
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
getVexflowDuration = function(duration, type) {
switch (duration) {
case "whole":
switch (type) {
case 0: return "w"; break; // 0 is normal note
Function getVexflowDuration
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
getVexflowDuration = function(duration, type) {
switch (duration) {
case "whole":
switch (type) {
case 0: return "w"; break; // 0 is normal note