Showing 168 of 286 total issues
Method search
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($pattern) {
$p = $pattern[0]->notes;
self::$patternArray = array();
self::$results = array();
Method generateResultExtract
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateResultExtract($upload_id, $part_id, $voice, $startMeasure, $start, $endMeasure, $end) {
set_time_limit(300);
$upload = Upload::find($upload_id);
$doc = new DOMDocument();
Method search
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($pattern) {
$p = $pattern[0]->notes;
self::$patternArray = array();
self::$results = array();
Function _countIntervals
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
private function _countIntervals($xml){
$tonika = array("C" => 0,
"D" => 2,
"E" => 4,
"F" => 5,
- 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 PatternModel.js
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @constructor */
MusicXMLAnalyzer.PatternModel = function(){
var that = {},
noteElements = [],
Function _mergeResults
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mergeResults = function(resultsArr) {
mergedArr = {
artist: [],
clef: null,
count_measures: 0.0,
Method _countIntervals
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _countIntervals($xml){
$tonika = array("C" => 0,
"D" => 2,
"E" => 4,
"F" => 5,
Function generateVexflowNotes
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateVexflowNotes = function(pattern, result) {
// prepare pattern if no result from ResultController.php
if (!result) {
for (var i = 0; i < pattern.measures.length; i++) {
for (var j = 0; j < pattern.measures[i].notes.length; j++) {
Function ResultController
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
MusicXMLAnalyzer.ResultController = function(){
var that = {},
model = null,
- 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 ResultController
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
MusicXMLAnalyzer.ResultController = function(){
var that = {},
model = null,
Method generateScore
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateScore($uploadId, $partId) {
$upload = Upload::find($uploadId);
if ($upload) {
$doc = new DOMDocument();
$doc->loadXML($upload->content);
Function _determineKey
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function _determineKey($xml){
$keys = $xml->xpath("//key");
$keysArray = array(
(object)array("label" => "C major", "value" => 0 ),
(object)array("label" => "G major", "value" => 0 ),
- 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
Method _determineKey
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _determineKey($xml){
$keys = $xml->xpath("//key");
$keysArray = array(
(object)array("label" => "C major", "value" => 0 ),
(object)array("label" => "G major", "value" => 0 ),
File DashboardView.js
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** @constructor */
MusicXMLAnalyzer.DashboardView = function(){
var that = {},
Function _getKey
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function _getKey($id){
$xml = simplexml_load_string(Upload::find($id)->content);
$keys = $xml->xpath("//key");
$key = $keys[0];
- 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 ScoreController
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
MusicXMLAnalyzer.ScoreController = function(){
var that = {},
view = null,
Function UploadView
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
MusicXMLAnalyzer.UploadView = function(){
var that = {},
$logMessages = null,
File ResultController.php
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Controller to handle result requests
* Generating result extracts for search results
Method search
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($pattern) {
$p = $pattern[0]->notes;
self::$patternIntervalArray = array();
Function _countNoteValues
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function _countNoteValues($xml){
$notes = $xml->xpath("//note");
$notesArray = array(
(object)array("label" => "B", "value" => 0 ),
- 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"