MiniDigger/Hangar

View on GitHub

Showing 518 of 518 total issues

Function takeoverReview has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def takeoverReview(author: String, slug: String, versionString: String): Action[String] = {
    Authenticated
      .andThen(PermissionAction(Permission.Reviewer))
      .asyncEitherT(parse.form(forms.ReviewDescription)) { implicit request =>
        for {
Severity: Minor
Found in ore/app/controllers/Reviews.scala - About 1 hr to fix

    Function patch_addContext_ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    diff_match_patch.prototype.patch_addContext_ = function(patch, text) {
      if (text.length == 0) {
        return;
      }
      if (patch.start2 === null) {

      Function diff_commonOverlap_ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
        // Cache the text lengths to prevent multiple calls.
        var text1_length = text1.length;
        var text2_length = text2.length;
        // Eliminate the null case.

        Function getData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          override def getData(bufferedReader: BufferedReader): Seq[DataValue] = {
            val dataValues = new ArrayBuffer[DataValue]
            try {
              val info = McModInfo.DEFAULT.read(bufferedReader).asScala
              if (info.lengthCompare(1) < 0) Nil
        Severity: Minor
        Found in orePlayCommon/app/ore/models/project/io/PluginFileData.scala - About 1 hr to fix

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

            def downloadRecommended(author: String, slug: String, token: Option[String]): Action[AnyContent] = {
              ProjectAction(author, slug).asyncEitherT { implicit request =>
                request.project
                  .recommendedVersion(ModelView.now(Version))
                  .sequence
          Severity: Major
          Found in ore/app/controllers/project/Versions.scala and 1 other location - About 1 hr to fix
          ore/app/controllers/project/Versions.scala on lines 885..894

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

          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

            def downloadRecommendedJar(author: String, slug: String, token: Option[String]): Action[AnyContent] = {
              ProjectAction(author, slug).asyncEitherT { implicit request =>
                request.project
                  .recommendedVersion(ModelView.now(Version))
                  .sequence
          Severity: Major
          Found in ore/app/controllers/project/Versions.scala and 1 other location - About 1 hr to fix
          ore/app/controllers/project/Versions.scala on lines 791..800

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

          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

          package ore.db.impl.schema
          
          import ore.db.impl.OrePostgresDriver.api._
          import ore.db.impl.table.StatTable
          import ore.models.project.Project
          models/src/main/scala/ore/db/impl/schema/VersionDownloadsTable.scala on lines 1..16

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

          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

          package ore.db.impl.schema
          
          import ore.db.impl.OrePostgresDriver.api._
          import ore.db.impl.table.StatTable
          import ore.models.project.Version
          models/src/main/scala/ore/db/impl/schema/ProjectViewsTable.scala on lines 1..15

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

          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 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private val id: ObjId[User],
              fullName: Option[String] = None,
              name: String = "",
              email: Option[String] = None,
              tagline: Option[String] = None,
          Severity: Major
          Found in models/src/main/scala/ore/models/user/User.scala - About 1 hr to fix

            Method rawApply has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  id: Option[DbRef[LoggedActionModel[Ctx]]],
                  createdAt: Option[Instant],
                  userId: DbRef[User],
                  address: InetString,
                  action: LoggedAction[Ctx],
            Severity: Major
            Found in models/src/main/scala/ore/db/impl/schema/LoggedActionTable.scala - About 1 hr to fix

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

                  api: DiscourseApi[F],
                  categoryDefault: Int,
                  categoryDeleted: Int,
                  topicTemplatePath: Path,
                  versionReleasePostTemplatePath: Path,
              Severity: Major
              Found in ore/app/discourse/OreDiscourseApiEnabled.scala - About 1 hr to fix

                Method getHomeProjects has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      currentUserId: Option[DbRef[User]],
                      canSeeHidden: Boolean,
                      platformNames: List[String],
                      categories: List[Category],
                      query: Option[String],
                Severity: Major
                Found in ore/app/db/impl/query/AppQueries.scala - About 1 hr to fix

                  Function apiV2Request has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function apiV2Request(url, method = "GET", data = {}) {
                      return getApiSession().then(function (session) {
                          return new Promise(function (resolve, reject) {
                              const isFormData = data instanceof FormData;
                              const isBodyRequest = (method === "POST" || method === "PUT" || method === "PATCH");
                  Severity: Minor
                  Found in ore/public/javascripts/apiRequests.js - About 1 hr to fix

                    Function checkPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Affix.prototype.checkPosition = function () {
                        if (!this.$element.is(':visible')) return
                    
                        var height       = this.$element.height()
                        var offset       = this.options.offset
                    Severity: Minor
                    Found in ore/public/bootstrap/js/bootstrap.js - About 1 hr to fix

                      Function getAuthors has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        ): Query0[(String, Option[Instant], Instant, Option[Role], Option[Role], Long)] = {
                          val (sort, reverse) = if (ordering.startsWith("-")) (ordering.substring(1), false) else (ordering, true)
                          val pageSize        = config.ore.users.authorPageSize
                          val offset          = (page - 1) * pageSize
                      
                      
                      Severity: Minor
                      Found in ore/app/db/impl/query/UserPagesQueries.scala - About 1 hr to fix

                        Function saveTo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          )(implicit service: ModelService[F], F: Monad[F]): EitherT[F, List[String], Unit] = {
                            val otherDbChannels = project.channels(ModelView.later(Channel)).filterView(_.name =!= oldName)
                            val query = project.channels(ModelView.raw(Channel)).filter(_.name === oldName).map { channel =>
                              (
                                channel,
                        Severity: Minor
                        Found in ore/app/form/project/TChannelData.scala - About 1 hr to fix

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

                                NonEmptyList
                                  .fromList(tags)
                                  .map { t =>
                                    fragParens(
                                      Fragments.or(
                          Severity: Major
                          Found in apiV2/app/db/impl/query/APIV2Queries.scala and 1 other location - About 1 hr to fix
                          apiV2/app/db/impl/query/APIV2Queries.scala on lines 142..153

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

                          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

                                NonEmptyList
                                  .fromList(tags)
                                  .map { t =>
                                    fragParens(
                                      Fragments.or(
                          Severity: Major
                          Found in apiV2/app/db/impl/query/APIV2Queries.scala and 1 other location - About 1 hr to fix
                          apiV2/app/db/impl/query/APIV2Queries.scala on lines 246..257

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

                          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

                              def addMessage[F[_]](message: Message)(implicit service: ModelService[F]): F[Model[Review]] = {
                                val messages = self.decodeMessages :+ message
                                service.update(self)(
                                  _.copy(
                                    message = Json.obj(
                          Severity: Major
                          Found in models/src/main/scala/ore/models/admin/Review.scala and 1 other location - About 1 hr to fix
                          models/src/main/scala/ore/models/project/Project.scala on lines 384..393

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

                          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

                              def addNote[F[_]](message: Note)(implicit service: ModelService[F]): F[Model[Project]] = {
                                val messages = self.decodeNotes :+ message
                                service.update(self)(
                                  _.copy(
                                    notes = Json.obj(
                          Severity: Major
                          Found in models/src/main/scala/ore/models/project/Project.scala and 1 other location - About 1 hr to fix
                          models/src/main/scala/ore/models/admin/Review.scala on lines 73..82

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

                          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