Showing 168 of 286 total issues
Function ApplicationController
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
MusicXMLAnalyzer.ApplicationController = function() {
var that = {},
headerController = null,
uploadController = null,
Method getDurationType
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDurationType($durationFloat) {
if ($durationFloat == 1){
return "whole";
} elseif ($durationFloat == 0.75) {
return "whole";
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = function(){
model = MusicXMLAnalyzer.ResultModel();
$(model).on('resultExtractReceived', onResultExtractReceived);
model.init();
Function initKeyDistribution
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initKeyDistribution = function(data) {
if (keyDistribution) {
keyDistribution.destroy();
}
keyDistribution = new d3pie("pie_keyDistribution", {
Function initNoteTypeDistribution
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initNoteTypeDistribution = function(data) {
if (noteTypeDistribution) {
noteTypeDistribution.destroy();
}
noteTypeDistribution = new d3pie("pie_noteTypeDistribution", {
Function setValuesForNoteElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setValuesForNoteElement = function() {
//accidential
if (curAccidential == "#") {
noteElementAccidential = 1;
Method search
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search()
{
// Getting files for current user
$user = User::find(Cookie::get('user_id'));
$user->uploads->each(function($upload) {
Function getInterval
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getInterval($n){
$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
Method up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
//Remove results <-> files relation
Schema::table('results', function($table) {
$table->dropForeign('results_file_id_foreign');
Method down
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function down()
{
//Remove results <-> uploads relation
Schema::table('results', function($table) {
$table->dropForeign('results_upload_id_foreign');
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = function() {
console.info("MusicXMLAnalyzer.ScoreController.init");
view = MusicXMLAnalyzer.ScoreView();
view.init();
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = function(){
$uploadModal = $('#uploadModal');
$uploadModal.data('backdrop', 'static');
$uploadModal.data('keyboard', false);
Method getInterval
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getInterval($n){
$tonika = array("C" => 0,
"D" => 2,
"E" => 4,
"F" => 5,
Function filesize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function filesize() {
// Assume failure
$result = -1;
$curl = curl_init( $this->url );
- 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 generateResultExtract
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function generateResultExtract($upload_id, $part_id, $voice, $startMeasure, $start, $endMeasure, $end) {
Avoid deeply nested control flow statements. Open
if (measures[i].ties[j].indexOf("start") > -1) {
tieStart = measures[i].notes[j];
}
Function getResultDetail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getResultDetail($id, $page) {
if (Cache::has('results') && Cache::has('pattern')) {
$results = Cache::get('results');
foreach ($results as $item) {
if ($item->file_id == $id) {
- 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 (curName != "break") {
noteElements.push(
{
type: curMode,
notes:
Avoid deeply nested control flow statements. Open
if (curName != "break") {
noteElements[0].notes.push(
{
type: "note",
pitch: {
Function renderNotes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
renderNotes = function(measures, canvas, renderer, context, stave, pattern) {