QutBioacousticsResearchGroup/bioacoustic-workbench

View on GitHub

Showing 93 of 184 total issues

Function VirtualBirdTourCtrl has 531 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function VirtualBirdTourCtrl($scope, $resource, $routeParams, $route, $http, Media, AudioEvent, Tag) {

            /*
             * TO DO:
             *  - choose more species
Severity: Major
Found in app/assets/javascripts/angular/controllers/experiments.js - About 2 days to fix

    File experiments.js has 968 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    ;
    (function (undefined) {
        var app = angular.module('bawApp.controllers');
    Severity: Major
    Found in app/assets/javascripts/angular/controllers/experiments.js - About 2 days to fix

      Function RapidScanCtrl has 274 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function RapidScanCtrl($scope, $resource, $routeParams, $route, $http, $timeout, Media, AudioEvent, Tag) {
                  function ts() {
                      return (new Date()).toISOString();
                  }
      
      
      Severity: Major
      Found in app/assets/javascripts/angular/controllers/experiments.js - About 1 day to fix

        File directives.js has 578 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        (function (undefined) {
            var bawds = angular.module('bawApp.directives', []);
        
            bawds.directive('bawRecordInformation', function () {
        
        
        Severity: Major
        Found in app/assets/javascripts/angular/directives/directives.js - About 1 day to fix

          Function ListenCtrl has 170 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function ListenCtrl($scope, $resource, $routeParams, $route, Media, AudioEvent, Tag) {
                      var CHUNK_DURATION_SECONDS = 30.0;
          
                      function getMediaParameters() {
                          return {
          Severity: Major
          Found in app/assets/javascripts/angular/controllers/listen.js - About 6 hrs to fix

            Function ExperimentsCtrl has 149 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        function ExperimentsCtrl($scope, $resource, $routeParams, $route, $http, Media, AudioEvent, Tag) {
            
                        $scope.PREFACE_STAGE = "Welcome";
                        $scope.EXPERIMENT_STAGE = "Activity";
                        $scope.FINAL_STAGE = "Conclusion";
            Severity: Major
            Found in app/assets/javascripts/angular/controllers/experiments.js - About 5 hrs to fix

              Function bawApp has 126 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var bawApp = (function (undefined) {
                  var exports = {
              
                  };
              
              
              Severity: Major
              Found in app/assets/javascripts/app.js - About 5 hrs to fix

                Method create_raw_query has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                  def create_raw_query
                
                    recordings_search = AudioRecording.scoped
                
                    if self.invalid?
                Severity: Minor
                Found in app/models/saved_search/saved_search_store.rb - About 4 hrs to fix

                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 create has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                  def create
                    success = nil
                
                    post_data = request.raw_post
                
                
                Severity: Minor
                Found in app/controllers/experiments_controller.rb - About 4 hrs to fix

                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 ProjectCtrl has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function ProjectCtrl($scope, $location, $resource, $routeParams, Project, Site, Photo, AudioEvent) {
                
                    var self = this;
                
                    var projectResource = Project; //$resource('/projects/:projectId', {projectId: $routeParams.projectId});
                Severity: Major
                Found in app/assets/javascripts/angular/controllers/projects.js - About 3 hrs to fix

                  File jquery.drawabox.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  
                  (function ($) {
                  
                      var SELECTED_ATTRIBUTE = "data-selected";
                  
                  
                  Severity: Minor
                  Found in lib/assets/javascripts/jquery.drawabox.js - About 3 hrs to fix

                    File callbacks_controller.rb has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class Api::CallbacksController < Devise::OmniauthCallbacksController
                      # this may be needed, but haven't needed it yet.
                      #skip_before_filter :verify_authenticity_token, :only => [:open_id]
                    
                      # NOTES
                    Severity: Minor
                    Found in app/controllers/api/callbacks_controller.rb - About 3 hrs to fix

                      Method create_or_update_user has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def create_or_update_user(canonical_data, user=nil)
                          authorization = nil
                      
                          #uid = canonical_data[:canonical][:uid] # very likely to be present
                          #name = canonical_data[:canonical][:name] # might be present
                      Severity: Minor
                      Found in app/controllers/api/callbacks_controller.rb - About 3 hrs to fix

                      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 item has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def item
                          # controller action for an individual media file
                      
                          # construct a hash of information to be returned and used for modify_parameters
                          @file_info = params
                      Severity: Minor
                      Found in app/controllers/media_controller.rb - About 3 hrs to fix

                      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 audio_harvester.rb has 301 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'yaml'
                      require 'net/http'
                      require 'json'
                      require 'digest'
                      require 'logger'
                      Severity: Minor
                      Found in lib/external/audio_harvester.rb - About 3 hrs to fix

                        Function link has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    link: function (scope, elements, attributes, controller) {
                                        var element = elements[0];
                                        if (element.nodeName !== "AUDIO") {
                                            throw 'Cannot put ngAudio element on an element that is not a <audio />';
                                        }
                        Severity: Major
                        Found in app/assets/javascripts/angular/directives/directives.js - About 2 hrs to fix

                          Function ProjectCtrl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function ProjectCtrl($scope, $location, $resource, $routeParams, Project, Site, Photo, AudioEvent) {
                          
                              var self = this;
                          
                              var projectResource = Project; //$resource('/projects/:projectId', {projectId: $routeParams.projectId});
                          Severity: Minor
                          Found in app/assets/javascripts/angular/controllers/projects.js - About 2 hrs to fix

                          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 modify_ffmpeg has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def self.modify_ffmpeg(source, target, modify_parameters = {})
                              # ffmpeg is the catch-all, so it will do anything specified in modify_parameters.
                          
                              raise ArgumentError, "Source is a wavpack file, use wavpack to convert to .wav first instead: #{File.basename(source)}" if source.match(/\.wv$/)
                          
                          
                          Severity: Major
                          Found in lib/modules/audio_ffmpeg.rb - About 2 hrs to fix

                            Method item has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def item
                                # controller action for an individual media file
                            
                                # construct a hash of information to be returned and used for modify_parameters
                                @file_info = params
                            Severity: Major
                            Found in app/controllers/media_controller.rb - About 2 hrs to fix

                              File services.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              (function () {
                                  /**
                                   * Helper method for adding a put request onto the standard angular resource service
                                   * @param $resource - the stub resource
                                   * @param {string} path - the web server path
                              Severity: Minor
                              Found in app/assets/javascripts/angular/services/services.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language