Showing 518 of 518 total issues
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
user
.projectRoles(ModelView.now(ProjectUserRole))
.get(id)
.semiflatMap { role =>
import MembershipDossier._
- Read upRead up
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 155.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
request.user
.organizationRoles(ModelView.now(OrganizationUserRole))
.get(id)
.semiflatMap { role =>
import MembershipDossier._
- Read upRead up
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 155.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function setupInvites
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupInvites() {
function fadeOutLoading(loading, after) {
loading.fadeOut('fast', after);
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
implicit val projectSortingStrategyQueryStringBindable: QueryStringBindable[ProjectSortingStrategy] =
new QueryStringBindable[ProjectSortingStrategy] {
override def bind(key: String, params: Map[String, Seq[String]]): Option[Either[String, ProjectSortingStrategy]] =
params.get(key).flatMap(_.headOption).map { s =>
ProjectSortingStrategy.values.find(_.apiName == s).toRight(s"$s is not a valid sorting strategy")
- Read upRead up
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 153.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
implicit val categoryQueryStringBindable: QueryStringBindable[Category] = new QueryStringBindable[Category] {
override def bind(key: String, params: Map[String, Seq[String]]): Option[Either[String, Category]] =
params.get(key).flatMap(_.headOption).map { s =>
Category.values.find(_.apiName == s).toRight(s"$s is not a valid category")
}
- Read upRead up
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 153.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 =>