Showing 229 of 518 total issues
File ApiV1Controller.scala
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
package controllers
import java.time.Instant
import java.util.{Base64, UUID}
import javax.inject.{Inject, Singleton}
File ProjectFactory.scala
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
package ore.models.project.factory
import java.nio.file.Files._
import javax.inject.{Inject, Singleton}
Function patch_fromText
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_fromText = function(textline) {
var patches = [];
if (!textline) {
return patches;
}
Constructor has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
pluginId: String,
ownerName: String,
ownerId: DbRef[User],
name: String,
slug: String,
Function diff_linesToChars_
has a Cognitive Complexity of 17 (exceeds 5 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.
- Read upRead up
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
Constructor has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
userId: DbRef[User],
address: InetString,
action: LoggedAction[Ctx],
actionContext: LoggedActionContext[Ctx],
actionContextId: DbRef[Ctx],
File Users.scala
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
package controllers
import javax.inject.{Inject, Singleton}
import play.api.i18n.MessagesApi
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Function getHomeProjects
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
): Query0[ProjectListEntry] = {
//TODO: Let the query handle tag search in the future
val platformFrag = platformNames.map(_.toLowerCase).toNel.map(Fragments.in(fr"lower(p.tag_name)", _))
val categoryFrag = categories.toNel.map(Fragments.in(fr"p.category", _))
val visibilityFrag =
Function create
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
)(implicit mdc: OreMDC): EitherT[F, List[String], Model[Organization]] = {
import cats.instances.vector._
val logging = F.delay {
MDCLogger.debug("Creating Organization...")
MDCLogger.debug("Name : " + name)
Constructor has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
projectId: DbRef[Project],
versionString: String,
dependencyIds: List[String],
channelId: DbRef[Channel],
fileSize: Long,
Function diff_cleanupEfficiency
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
var changes = false;
var equalities = []; // Stack of indices where equalities are found.
var equalitiesLength = 0; // Keeping our own length var is faster in JS.
/** @type {?string} */
Function wrapExternal
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private def wrapExternal(urlString: String) = {
try {
val uri = new URI(urlString)
val host = uri.getHost
if (uri.getScheme != null && host == null) { // scalafix:ok
- Read upRead up
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 getData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings(Array("scalafix:DisableSyntax.null"))
override def getData(bufferedReader: BufferedReader): Seq[DataValue] = {
val dataValues = new ArrayBuffer[DataValue]
try {
val info = McModInfo.DEFAULT.read(bufferedReader).asScala
- Read upRead up
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 setupInvites
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupInvites() {
function fadeOutLoading(loading, after) {
loading.fadeOut('fast', after);
}
Constructor has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
categoryName: String,
homepage: String,
issues: String,
source: String,
support: String,
Function of
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
): F[ProjectData] = {
val flagsWithNames = project
.flags(ModelView.later(Flag))
.query
.join(TableQuery[UserTable])
Function saveTo
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
): F[Unit] = {
import cats.instances.list._
import cats.instances.option._
import cats.instances.vector._
Function sendJar
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
): IO[Result] = {
if (project.visibility == Visibility.SoftDelete) {
IO.pure(NotFound)
} else {
checkConfirmation(version, token).flatMap { passed =>
Function getApiSession
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getApiSession() {
return new Promise(function (resolve, reject) {
let session;
const date = new Date();
date.setTime(date.getTime() + 60000);