QutBioacousticsResearchGroup/bioacoustic-workbench

View on GitHub

Showing 184 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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  app.controller('ListenCtrl', ['$scope', '$location', '$resource', '$routeParams',  'User',
              
              
                      function UserCtrl($scope, $location, $resource, $routeParams, User) {
              
              Severity: Major
              Found in app/assets/javascripts/angular/controllers/users.js and 1 other location - About 5 hrs to fix
              app/assets/javascripts/angular/controllers/users.js on lines 26..42

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 140.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  app.controller('ListenCtrl', ['$scope', '$location', '$resource', '$routeParams',  'User',
              
              
                      function UserCtrl($scope, $location, $resource, $routeParams, User) {
              
              Severity: Major
              Found in app/assets/javascripts/angular/controllers/users.js and 1 other location - About 5 hrs to fix
              app/assets/javascripts/angular/controllers/users.js on lines 8..24

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 140.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                if (value.stepType == STEP_TYPE_TRANSITION) {
                                    $scope.bigScope.results.order.push({
                                        index: index,
                                        fromLocationName: value.fromLocation ? value.fromLocation.name : null,
                                        fromLocationOrderIdentifier: value.fromLocation ? value.fromLocation.locationOrderIdentifier : null,
                Severity: Major
                Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/angular/controllers/experiments.js on lines 1247..1257

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 125.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                } else if (value.stepType == STEP_TYPE_ACTIVITY) {
                                    $scope.bigScope.results.order.push({
                                        index: index,
                                        locationName: value.location ? value.location.name : null,
                                        locationOrderIdentifier: value.location ? value.location.locationOrderIdentifier : null,
                Severity: Major
                Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/angular/controllers/experiments.js on lines 1239..1257

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 125.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                function BookmarksCtrl($scope, $resource, Bookmark) {
                    $scope.bookmarksResource = $resource('/bookmarks', {});
                    $scope.bookmarks = $scope.bookmarksResource.query();
                
                    $scope.links = function(key) {
                Severity: Major
                Found in app/assets/javascripts/angular/controllers/bookmarks.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/angular/controllers/audio_events.js on lines 3..14

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 122.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                function AudioEventsCtrl($scope, $resource, Project) {
                    $scope.audioEventsResource = $resource('/audioEvents', {});
                    $scope.audioEvents = $scope.audioEventsResource.query();
                
                    $scope.links = function(key) {
                Severity: Major
                Found in app/assets/javascripts/angular/controllers/audio_events.js and 1 other location - About 4 hrs to fix
                app/assets/javascripts/angular/controllers/bookmarks.js on lines 3..14

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 122.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                      for (var verifyAnnotationIndex = 0; verifyAnnotationIndex < annotations.length; verifyAnnotationIndex++) {
                                          $scope.currentStepResults.annotationVerifyOrder.push({
                                              'index': verifyAnnotationIndex,
                                              'step': $scope.step,
                                              'annotationId': annotations[verifyAnnotationIndex].id,
                      Severity: Major
                      Found in app/assets/javascripts/angular/controllers/experiments.js and 1 other location - About 3 hrs to fix
                      app/assets/javascripts/angular/controllers/experiments.js on lines 892..900

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 102.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language