MiniDigger/Hangar

View on GitHub

Showing 518 of 518 total issues

Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    id: Long,
    username: String,
    email: String,
    avatarUrl: Option[String],
    lang: Option[Locale],
Severity: Minor
Found in auth/src/main/scala/ore/auth/AuthUser.scala - About 45 mins to fix

    Function onCustomSubmit has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var onCustomSubmit = function(toggle, channelName, channelHex, title, submit, nonReviewed) {
    Severity: Minor
    Found in ore/public/javascripts/channelManage.js - About 45 mins to fix

      Function diff_xIndex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
        var chars1 = 0;
        var chars2 = 0;
        var last_chars1 = 0;
        var last_chars2 = 0;
      Severity: Minor
      Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins 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 showUserAction has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            user: String,
            sort: Option[ProjectSortingStrategy],
            limit: Option[Long],
            offset: Long,
            query: (
      Severity: Minor
      Found in apiV2/app/controllers/apiv2/ApiV2Controller.scala - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  for (var y = 0; y < patches[x].diffs.length; y++) {
                    var mod = patches[x].diffs[y];
                    if (mod[0] !== DIFF_EQUAL) {
                      index2 = this.diff_xIndex(diffs, index1);
                    }
        Severity: Major
        Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (x1 >= x2) {
                      // Overlap detected.
                      return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
                    }
          Severity: Major
          Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (commonlength !== 0) {
                          diffs[pointer][1] = text_insert.substring(text_insert.length -
                              commonlength) + diffs[pointer][1];
                          text_insert = text_insert.substring(0, text_insert.length -
                              commonlength);
            Severity: Major
            Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      if os.path.isfile(old_sig_path):
                        print("Old sig: " + old_sig_path + "\nNew sig: " + new_sig_path)
                        os.rename(old_sig_path, new_sig_path)
                else:
              Severity: Major
              Found in scripts/fix_file_paths_ecd8100.py3 - About 45 mins to fix

                Method apply has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      loginUrl: String,
                      signupUrl: String,
                      verifyUrl: String,
                      secret: String,
                      timeout: FiniteDuration,
                Severity: Minor
                Found in auth/src/main/scala/ore/auth/AkkaSSOApi.scala - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (x1 >= x2) {
                              // Overlap detected.
                              return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
                            }
                  Severity: Major
                  Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if (best_loc > loc) {
                                // When passing loc, don't exceed our current distance from loc.
                                start = Math.max(1, 2 * loc - best_loc);
                              } else {
                                // Already passed loc, downhill from here on in.
                    Severity: Major
                    Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

                      Method starredQuery has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            user: String,
                            canSeeHidden: Boolean,
                            currentUserId: Option[DbRef[User]],
                            order: ProjectSortingStrategy,
                            limit: Long,
                      Severity: Minor
                      Found in apiV2/app/db/impl/query/APIV2Queries.scala - About 45 mins to fix

                        Method startVersion has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              plugin: PluginFileWithData,
                              pluginId: String,
                              projectId: Option[DbRef[Project]],
                              projectUrl: String,
                              forumSync: Boolean,
                        Severity: Minor
                        Found in orePlayCommon/app/ore/models/project/factory/ProjectFactory.scala - About 45 mins to fix

                          Method showUserGrid has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                author: String,
                                slug: String,
                                page: Option[Int],
                                title: String,
                                query: Model[Project] => Query[UserTable, Model[User], Seq],
                          Severity: Minor
                          Found in ore/app/controllers/project/Projects.scala - About 45 mins to fix

                            Method confirmDownload has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                  author: String,
                                  slug: String,
                                  target: String,
                                  downloadType: Option[Int],
                                  token: Option[String],
                            Severity: Minor
                            Found in ore/app/controllers/project/Versions.scala - About 45 mins to fix

                              Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                    implicit service: ModelService[F],
                                    config: OreConfig,
                                    forums: OreDiscourseApi[F],
                                    fileManager: ProjectFiles,
                                    F: cats.effect.Effect[F],
                              Severity: Minor
                              Found in orePlayCommon/app/db/impl/access/ProjectBase.scala - About 45 mins to fix

                                Method getProjects has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                      username: String,
                                      currentUserId: Option[DbRef[User]],
                                      canSeeHidden: Boolean,
                                      order: ProjectSortingStrategy,
                                      pageSize: Long,
                                Severity: Minor
                                Found in ore/app/db/impl/query/UserPagesQueries.scala - About 45 mins to fix

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

                                          this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
                                  Severity: Minor
                                  Found in ore/public/bootstrap/js/bootstrap.js and 1 other location - About 45 mins to fix
                                  ore/public/bootstrap/js/bootstrap.js on lines 1069..1069

                                  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 50.

                                  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

                                  Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      namespace: ProjectNamespace,
                                      topicId: Option[Int],
                                      postId: Option[Int],
                                      isTopicDirty: Boolean,
                                      lastUpdated: Timestamp,
                                  Severity: Minor
                                  Found in ore/app/models/querymodels/UnhealtyProject.scala - About 45 mins to fix

                                    Method showDownloadConfirm has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                          author: String,
                                          slug: String,
                                          target: String,
                                          downloadType: Option[Int],
                                          api: Option[Boolean],
                                    Severity: Minor
                                    Found in ore/app/controllers/project/Versions.scala - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language