MiniDigger/Hangar

View on GitHub

Showing 518 of 518 total issues

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

    runUpdates(dirtyPostVersions, "Failed to update dirty version") { toUpdate =>
      Logger.debug(s"Updating ${toUpdate.size} posts...")
      toUpdate.parTraverse(t => this.api.updateVersionPost(t._1, t._2))
    }
Severity: Minor
Found in ore/app/discourse/RecoveryTask.scala and 1 other location - About 50 mins to fix
ore/app/discourse/RecoveryTask.scala on lines 83..86

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

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

    runUpdates(toCreateVersions, "Failed to create version post") { toCreate =>
      Logger.debug(s"Creating ${toCreate.size} posts...")
      toCreate.parTraverse(t => this.api.createVersionPost(t._1, t._2))
    }
Severity: Minor
Found in ore/app/discourse/RecoveryTask.scala and 1 other location - About 50 mins to fix
ore/app/discourse/RecoveryTask.scala on lines 88..91

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

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

object DbRole extends ModelCompanionPartial[DbRole, DbRoleTable](TableQuery[DbRoleTable]) {

  override def asDbModel(
      model: DbRole,
      id: ObjId[DbRole],
Severity: Minor
Found in models/src/main/scala/ore/models/user/role/DbRole.scala and 1 other location - About 50 mins to fix
models/src/main/scala/ore/models/project/VersionTag.scala on lines 21..30

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

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

object VersionTag extends ModelCompanionPartial[VersionTag, VersionTagTable](TableQuery[VersionTagTable]) {

  override def asDbModel(
      model: VersionTag,
      id: ObjId[VersionTag],
Severity: Minor
Found in models/src/main/scala/ore/models/project/VersionTag.scala and 1 other location - About 50 mins to fix
models/src/main/scala/ore/models/user/role/DbRole.scala on lines 25..34

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

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 3 locations. Consider refactoring.
Open

package ore.models.project

import ore.data.DownloadType
import ore.db.impl.DefaultModelCompanion
import ore.db.impl.schema.UnsafeDownloadsTable
Severity: Major
Found in models/src/main/scala/ore/models/project/UnsafeDownload.scala and 2 other locations - About 45 mins to fix
models/src/main/scala/ore/models/api/ApiSession.scala on lines 1..21
models/src/main/scala/ore/models/user/SignOn.scala on lines 1..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 77.

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 3 locations. Consider refactoring.
Open

package ore.models.api

import java.time.Instant

import ore.db.impl.DefaultModelCompanion
Severity: Major
Found in models/src/main/scala/ore/models/api/ApiSession.scala and 2 other locations - About 45 mins to fix
models/src/main/scala/ore/models/project/UnsafeDownload.scala on lines 1..29
models/src/main/scala/ore/models/user/SignOn.scala on lines 1..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 77.

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 3 locations. Consider refactoring.
Open

package ore.models.user

import ore.db.ModelQuery
import ore.db.impl.DefaultModelCompanion
import ore.db.impl.schema.SignOnTable
Severity: Major
Found in models/src/main/scala/ore/models/user/SignOn.scala and 2 other locations - About 45 mins to fix
models/src/main/scala/ore/models/api/ApiSession.scala on lines 1..21
models/src/main/scala/ore/models/project/UnsafeDownload.scala on lines 1..29

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

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

Avoid deeply nested control flow statements.
Open

          if (diff_type === DIFF_EQUAL) {
            patch.length2 += diff_text.length;
            start2 += diff_text.length;
          } else {
            empty = false;
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

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

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