MiniDigger/Hangar

View on GitHub
ore/app/db/impl/query/UserPagesQueries.scala

Summary

Maintainability
A
3 hrs
Test Coverage

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

  ): Query0[ProjectListEntry] = {
    val visibilityFrag =
      if (canSeeHidden) None
      else
        currentUserId.fold(Some(fr"(p.visibility = 1)")) { id =>
Severity: Minor
Found in ore/app/db/impl/query/UserPagesQueries.scala - 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

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

            username: String,
            currentUserId: Option[DbRef[User]],
            canSeeHidden: Boolean,
            order: ProjectSortingStrategy,
            pageSize: Long,
      Severity: Minor
      Found in ore/app/db/impl/query/UserPagesQueries.scala - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status