MiniDigger/Hangar

View on GitHub

Showing 229 of 518 total issues

Function confirmDownload0 has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  ): OptionT[IO, (Model[UnsafeDownload], Option[play.api.mvc.Session])] = {
    val addr = InetString(StatTracker.remoteAddress)
    val dlType = downloadType
      .flatMap(DownloadType.withValueOpt)
      .getOrElse(DownloadType.UploadedFile)
Severity: Minor
Found in ore/app/controllers/project/Versions.scala - About 1 hr to fix

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

        createdAt: LocalDateTime,
        name: String,
        dependenciesIds: List[String],
        visibility: Visibility,
        description: Option[String],
    Severity: Major
    Found in apiV2/app/models/querymodels/apiV2QueryModels.scala - About 1 hr to fix

      Function authenticate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        override def authenticate(payload: String, sig: String)(isNonceValid: String => F[Boolean]): OptionT[F, AuthUser] = {
          Logger.debug("Authenticating SSO payload...")
          Logger.debug(payload)
          Logger.debug("Signed with : " + sig)
          if (generateSignature(payload) != sig) {
      Severity: Minor
      Found in auth/src/main/scala/ore/auth/AkkaSSOApi.scala - About 1 hr to fix

        Function versionSelectFrag has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          ): Fragment = {
            val base =
              sql"""|SELECT pv.created_at,
                    |       pv.version_string,
                    |       pv.dependencies,
        Severity: Minor
        Found in apiV2/app/db/impl/query/APIV2Queries.scala - About 1 hr to fix

          Function createProject has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            ): EitherT[IO, String, (Project, ProjectSettings)] = {
              val name = template.name
              val slug = slugify(name)
              val project = Project(
                pluginId = template.pluginId,
          Severity: Minor
          Found in orePlayCommon/app/ore/models/project/factory/ProjectFactory.scala - About 1 hr to fix

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

            function setupAvatarForm() {
            
                $('.btn-got-it').click(function () {
                    var prompt = $(this).closest('.prompt');
                    $.ajax({
            Severity: Minor
            Found in ore/public/javascripts/userPage.js - About 1 hr to fix

              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

                  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.

                    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

                                  Function writeProjects has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    ): IO[Seq[(Model[Project], JsObject)]] = {
                                      val projectIds = projects.map(_._1.id.value)
                                      val versionIds = projects.map(_._2.id.value)
                                  
                                      for {
                                  Severity: Minor
                                  Found in ore/app/ore/rest/OreRestfulApiV1.scala - About 1 hr to fix

                                    Function toString has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    diff_match_patch.patch_obj.prototype.toString = function() {
                                      var coords1, coords2;
                                      if (this.length1 === 0) {
                                        coords1 = this.start1 + ',0';
                                      } else if (this.length1 == 1) {

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

                                            created_at: LocalDateTime,
                                            name: String,
                                            dependencies: List[VersionDependency],
                                            visibility: Visibility,
                                            description: Option[String],
                                      Severity: Major
                                      Found in apiV2/app/models/protocols/APIV2.scala - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language