MiniDigger/Hangar

View on GitHub

Showing 229 of 518 total issues

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

    createdBy: Option[DbRef[User]],
    projectId: DbRef[Project],
    comment: String,
    resolvedAt: Option[Instant],
    resolvedBy: Option[DbRef[User]],
Severity: Minor
Found in models/src/main/scala/ore/models/admin/ProjectVisibilityChange.scala - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (commonlength !== 0) {
                  if ((pointer - count_delete - count_insert) > 0 &&
                      diffs[pointer - count_delete - count_insert - 1][0] ==
                      DIFF_EQUAL) {
                    diffs[pointer - count_delete - count_insert - 1][1] +=
    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 user_input == "yes":
                print("Deleted " + project_name)
                cursor.execute("DELETE FROM projects WHERE id = " + project_id)
              elif user_input == "no":
                print("Setting the Recommended Version ID to -1")
      Severity: Major
      Found in scripts/file_migration_b725a7c.py3 - About 45 mins to fix

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

            expiration: Instant,
            token: String,
            versionId: DbRef[Version],
            address: InetString,
            isConfirmed: Boolean = false,
        Severity: Minor
        Found in models/src/main/scala/ore/models/project/DownloadWarning.scala - About 45 mins to fix

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

                homepage: Option[String],
                issues: Option[String],
                sources: Option[String],
                support: Option[String],
                license: ProjectLicense,
          Severity: Minor
          Found in apiV2/app/models/protocols/APIV2.scala - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                    while True:
                      user_input = input("Delete " + project_name + "? [yes/no] ")
                      if user_input in ["yes", "no"]:
                        break
                      else:
            Severity: Major
            Found in scripts/file_migration_b725a7c.py3 - About 45 mins to fix

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

                  userId: DbRef[User],
                  originId: Option[DbRef[User]] = None,
                  notificationType: NotificationType,
                  messageArgs: NEL[String],
                  action: Option[String] = None,
              Severity: Minor
              Found in models/src/main/scala/ore/models/user/Notification.scala - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (diff_text == bigpatch.diffs[0][1]) {
                            bigpatch.diffs.shift();
                          } else {
                            bigpatch.diffs[0][1] =
                                bigpatch.diffs[0][1].substring(diff_text.length);
                Severity: Major
                Found in ore/public/diff-match-patch/javascript/diff_match_patch_uncompressed.js - About 45 mins to fix

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

                      projectId: DbRef[Project],
                      parentId: Option[DbRef[Page]],
                      name: String,
                      slug: String,
                      isDeletable: Boolean,
                  Severity: Minor
                  Found in models/src/main/scala/ore/models/project/Page.scala - About 45 mins to fix

                    Method watchingQuery 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

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

                            apiKey: String,
                            adminUser: String,
                            apiUri: Uri,
                            breakerMaxFailures: Int,
                            breakerResetDur: FiniteDuration,
                      Severity: Minor
                      Found in discourse/src/main/scala/ore/discourse/AkkaDiscourseApi.scala - About 45 mins to fix

                        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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language