MiniDigger/Hangar

View on GitHub

Showing 229 of 518 total issues

File bootstrap.js has 1595 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in ore/public/bootstrap/js/bootstrap.js - About 4 days to fix

    File diff_match_patch_uncompressed.js has 1457 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Diff Match and Patch
     * Copyright 2018 The diff-match-patch Authors.
     * https://github.com/google/diff-match-patch
     *

      File Versions.scala has 708 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package controllers.project
      
      import java.nio.file.Files._
      import java.nio.file.{Files, StandardCopyOption}
      import java.time.Instant
      Severity: Major
      Found in ore/app/controllers/project/Versions.scala - About 1 day to fix

        File ApiV2Controller.scala has 635 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package controllers.apiv2
        
        import scala.language.higherKinds
        
        import java.nio.file.Path
        Severity: Major
        Found in apiV2/app/controllers/apiv2/ApiV2Controller.scala - About 1 day to fix

          Function loadVersions has 221 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function loadVersions(increment, scrollTop) {
              var versionList = $('.version-table');
          
              var offset = (page + increment - 1) * VERSIONS_PER_PAGE;
              var url = 'projects/' + PLUGIN_ID + '/versions' + '?offset=' + offset;
          Severity: Major
          Found in ore/public/javascripts/versionList.js - About 1 day to fix

            Function patch_apply has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
            Open

            diff_match_patch.prototype.patch_apply = function(patches, text) {
              if (patches.length == 0) {
                return [text, []];
              }
            
            

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

            diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
              // Cache the text lengths to prevent multiple calls.
              var text1_length = text1.length;
              var text2_length = text2.length;
              var max_d = Math.ceil((text1_length + text2_length) / 2);

            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 Projects.scala has 499 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package controllers.project
            
            import java.nio.file.{Files, Path}
            import java.security.MessageDigest
            import java.util.Base64
            Severity: Minor
            Found in ore/app/controllers/project/Projects.scala - About 1 day to fix

              Function diff_cleanupMerge has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
              Open

              diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
                // Add a dummy entry at the end.
                diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));
                var pointer = 0;
                var count_delete = 0;

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

              diff_match_patch.prototype.patch_splitMax = function(patches) {
                var patch_size = this.Match_MaxBits;
                for (var x = 0; x < patches.length; x++) {
                  if (patches[x].length1 <= patch_size) {
                    continue;

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

              diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
                /**
                 * Given two strings, compute a score representing whether the internal
                 * boundary falls on logical boundaries.
                 * Scores range from 6 (best) to 0 (worst).

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

              diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
                if (pattern.length > this.Match_MaxBits) {
                  throw new Error('Pattern too long for this browser.');
                }
              
              

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

              diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
                var changes = false;
                var equalities = [];  // Stack of indices where equalities are found.
                var equalitiesLength = 0;  // Keeping our own length var is faster in JS.
                /** @type {?string} */

              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 Application.scala has 352 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package controllers
              
              import java.sql.Timestamp
              import java.time.temporal.ChronoUnit
              import java.time.{Instant, LocalDate}
              Severity: Minor
              Found in ore/app/controllers/Application.scala - About 4 hrs to fix

                File APIV2Queries.scala has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package db.impl.query
                
                import java.sql.Timestamp
                import java.time.LocalDateTime
                
                
                Severity: Minor
                Found in apiV2/app/db/impl/query/APIV2Queries.scala - About 4 hrs to fix

                  Function diff_cleanupEfficiency has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                  diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
                    var changes = false;
                    var equalities = [];  // Stack of indices where equalities are found.
                    var equalitiesLength = 0;  // Keeping our own length var is faster in JS.
                    /** @type {?string} */

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

                  diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
                    // Add a dummy entry at the end.
                    diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));
                    var pointer = 0;
                    var count_delete = 0;

                    File OreRestfulApiV1.scala has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package ore.rest
                    
                    import java.lang.Math._
                    import javax.inject.{Inject, Singleton}
                    
                    
                    Severity: Minor
                    Found in ore/app/ore/rest/OreRestfulApiV1.scala - About 4 hrs to fix

                      Function initBtnEdit has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function initBtnEdit() {
                          var btnEdit = $('.btn-edit');
                          if (!btnEdit.length) return;
                      
                          var pageBtns = $('.btn-page');
                      Severity: Major
                      Found in ore/public/javascripts/projectDetail.js - About 3 hrs to fix

                        Function patch_make has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                        Open

                        diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
                          var text1, diffs;
                          if (typeof a == 'string' && typeof opt_b == 'string' &&
                              typeof opt_c == 'undefined') {
                            // Method 1: text1, text2

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language