MiniDigger/Hangar

View on GitHub

Showing 518 of 518 total issues

Function show has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Collapse.prototype.show = function () {
    if (this.transitioning || this.$element.hasClass('in')) return

    var activesData
    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
Severity: Minor
Found in ore/public/bootstrap/js/bootstrap.js - About 1 hr to fix

    Function getProjectList has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      ): IO[JsValue] = {
        val cats: Option[Seq[Category]] = categories.map(Category.fromString).map(_.toSeq)
        val ordering                    = sort.map(ProjectSortingStrategy.withValue).getOrElse(ProjectSortingStrategy.Default)
    
        val maxLoad = this.config.ore.projects.initLoad
    Severity: Minor
    Found in ore/app/ore/rest/OreRestfulApiV1.scala - About 1 hr to fix

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

        final case class AuthedOrganizationRequest[A](
            override val data: OrganizationData,
            override val scoped: ScopedOrganizationData,
            override val headerData: HeaderData,
            override val request: AuthRequest[A]
      Severity: Major
      Found in orePlayCommon/app/controllers/sugar/Requests.scala and 1 other location - About 1 hr to fix
      orePlayCommon/app/controllers/sugar/Requests.scala on lines 156..168

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

      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

        final case class AuthedProjectRequest[A](
            override val data: ProjectData,
            override val scoped: ScopedProjectData,
            override val headerData: HeaderData,
            override val request: AuthRequest[A]
      Severity: Major
      Found in orePlayCommon/app/controllers/sugar/Requests.scala and 1 other location - About 1 hr to fix
      orePlayCommon/app/controllers/sugar/Requests.scala on lines 201..212

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

      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

      Function diff_main has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,
          opt_deadline) {
        // Set a deadline by which time the diff must be complete.
        if (typeof opt_deadline == 'undefined') {
          if (this.Diff_Timeout <= 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 diff_linesToChars_ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
        var lineArray = [];  // e.g. lineArray[4] == 'Hello\n'
        var lineHash = {};   // e.g. lineHash['Hello\n'] == 4
      
        // '\x00' is a valid character, but various debuggers don't like it.

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

            searchBar.find('input').on('keypress', function(event) {
                if (event.keyCode === KEY_ENTER) {
                    event.preventDefault();
                    $(this).next().find('.btn').click();
                }
        Severity: Major
        Found in ore/public/javascripts/home.js and 1 other location - About 1 hr to fix
        ore/public/javascripts/userSearch.js on lines 13..18

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

        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

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

            input.on('keypress', function(event) {
                if (event.keyCode === KEY_ENTER) {
                    event.preventDefault();
                    $(this).next().find('.btn').click();
                }
        Severity: Major
        Found in ore/public/javascripts/userSearch.js and 1 other location - About 1 hr to fix
        ore/public/javascripts/home.js on lines 50..55

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

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

            postId: Int,
            topicId: Int,
            userId: Int,
            username: String,
            topicSlug: String,
        Severity: Major
        Found in discourse/src/main/scala/ore/discourse/DiscoursePost.scala - About 1 hr to fix

          Method projectQuery has 11 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                pluginId: Option[String],
                category: List[Category],
                tags: List[String],
                query: Option[String],
                owner: Option[String],
          Severity: Major
          Found in apiV2/app/db/impl/query/APIV2Queries.scala - About 1 hr to fix

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

                namespace: ProjectNamespace,
                projectName: String,
                versionString: String,
                versionCreatedAt: Instant,
                channelName: String,
            Severity: Major
            Found in ore/app/models/querymodels/queueEntry.scala - About 1 hr to fix

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

                  namespace: ProjectNamespace,
                  projectName: String,
                  versionString: String,
                  versionCreatedAt: Instant,
                  channelName: String,
              Severity: Major
              Found in ore/app/models/querymodels/queueEntry.scala - About 1 hr to fix

                Function bindExpand has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function bindExpand(e) {
                    e.click(function() {
                        var pageId = $(this).data('page-id');
                        var listItem = $(this).closest('.list-group-item');
                        var $this = $(this);
                Severity: Minor
                Found in ore/public/javascripts/pageCollapse.js - About 1 hr to fix

                  Function createLogger has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def createLogger(name: String): LogHandler = {
                      val logger = scalalogging.Logger(name)
                  
                      LogHandler {
                        case util.log.Success(sql, args, exec, processing) =>
                  Severity: Minor
                  Found in models/src/main/scala/ore/db/impl/query/DoobieOreProtocol.scala - About 1 hr to fix

                    Function actionFrag has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      ): Fragment = {
                        val base =
                          sql"""|SELECT p.plugin_id,
                                |       p.name,
                                |       p.owner_name,
                    Severity: Minor
                    Found in apiV2/app/db/impl/query/APIV2Queries.scala - About 1 hr to fix

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

                            object session extends ConfigCategory {
                              val raw: Configuration = api.raw.get[Configuration]("session")
                      
                              val publicExpiration: FiniteDuration = raw.get[FiniteDuration]("public-expiration")
                              val expiration: FiniteDuration       = raw.get[FiniteDuration]("expiration")
                      Severity: Major
                      Found in orePlayCommon/app/ore/OreConfig.scala and 3 other locations - About 1 hr to fix
                      orePlayCommon/app/ore/OreConfig.scala on lines 100..105
                      orePlayCommon/app/ore/OreConfig.scala on lines 139..144
                      orePlayCommon/app/ore/OreConfig.scala on lines 168..173

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

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

                            object breaker extends ConfigCategory {
                              val raw: Configuration      = api.raw.get[Configuration]("breaker")
                              val maxFailures: Int        = raw.get[Int]("max-failures")
                              val reset: FiniteDuration   = raw.get[FiniteDuration]("reset")
                              val timeout: FiniteDuration = raw.get[FiniteDuration]("timeout")
                      Severity: Major
                      Found in orePlayCommon/app/ore/OreConfig.scala and 3 other locations - About 1 hr to fix
                      orePlayCommon/app/ore/OreConfig.scala on lines 100..105
                      orePlayCommon/app/ore/OreConfig.scala on lines 115..122
                      orePlayCommon/app/ore/OreConfig.scala on lines 168..173

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

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

                            object breaker extends ConfigCategory {
                              val raw: Configuration      = api.raw.get[Configuration]("breaker")
                              val maxFailures: Int        = raw.get[Int]("max-failures")
                              val reset: FiniteDuration   = raw.get[FiniteDuration]("reset")
                              val timeout: FiniteDuration = raw.get[FiniteDuration]("timeout")
                      Severity: Major
                      Found in orePlayCommon/app/ore/OreConfig.scala and 3 other locations - About 1 hr to fix
                      orePlayCommon/app/ore/OreConfig.scala on lines 100..105
                      orePlayCommon/app/ore/OreConfig.scala on lines 115..122
                      orePlayCommon/app/ore/OreConfig.scala on lines 139..144

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

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

                          object orgs extends ConfigCategory {
                            val raw: Configuration       = ore.raw.get[Configuration]("orgs")
                            val enabled: Boolean         = raw.get[Boolean]("enabled")
                            val dummyEmailDomain: String = raw.get[String]("dummyEmailDomain")
                            val createLimit: Int         = raw.get[Int]("createLimit")
                      Severity: Major
                      Found in orePlayCommon/app/ore/OreConfig.scala and 3 other locations - About 1 hr to fix
                      orePlayCommon/app/ore/OreConfig.scala on lines 115..122
                      orePlayCommon/app/ore/OreConfig.scala on lines 139..144
                      orePlayCommon/app/ore/OreConfig.scala on lines 168..173

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

                      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

                          Authenticated.andThen(PermissionAction(Permission.IsStaff)).asyncF { implicit request =>
                            val ordering = sort.getOrElse(UserOrdering.Role)
                            val p        = page.getOrElse(1)
                      
                            service.runDbCon(UserPagesQueries.getStaff(p, ordering).to[Vector]).map { u =>
                      Severity: Major
                      Found in ore/app/controllers/Users.scala and 1 other location - About 1 hr to fix
                      ore/app/controllers/Users.scala on lines 245..252

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

                      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