Showing 229 of 518 total issues
Function confirmDownload0
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
): OptionT[IO, (Model[UnsafeDownload], Option[play.api.mvc.Session])] = {
val addr = InetString(StatTracker.remoteAddress)
val dlType = downloadType
.flatMap(DownloadType.withValueOpt)
.getOrElse(DownloadType.UploadedFile)
Constructor has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createdAt: LocalDateTime,
name: String,
dependenciesIds: List[String],
visibility: Visibility,
description: Option[String],
Function authenticate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function versionSelectFrag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
): Fragment = {
val base =
sql"""|SELECT pv.created_at,
| pv.version_string,
| pv.dependencies,
Function createProject
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
): EitherT[IO, String, (Project, ProjectSettings)] = {
val name = template.name
val slug = slugify(name)
val project = Project(
pluginId = template.pluginId,
Function setupAvatarForm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupAvatarForm() {
$('.btn-got-it').click(function () {
var prompt = $(this).closest('.prompt');
$.ajax({
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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')
Function getProjectList
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function diff_main
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
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) {
- 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 diff_linesToChars_
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
postId: Int,
topicId: Int,
userId: Int,
username: String,
topicSlug: String,
Method projectQuery
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
pluginId: Option[String],
category: List[Category],
tags: List[String],
query: Option[String],
owner: Option[String],
Constructor has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
namespace: ProjectNamespace,
projectName: String,
versionString: String,
versionCreatedAt: Instant,
channelName: String,
Constructor has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
namespace: ProjectNamespace,
projectName: String,
versionString: String,
versionCreatedAt: Instant,
channelName: String,
Function bindExpand
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function bindExpand(e) {
e.click(function() {
var pageId = $(this).data('page-id');
var listItem = $(this).closest('.list-group-item');
var $this = $(this);
Function createLogger
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def createLogger(name: String): LogHandler = {
val logger = scalalogging.Logger(name)
LogHandler {
case util.log.Success(sql, args, exec, processing) =>
Function actionFrag
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
): Fragment = {
val base =
sql"""|SELECT p.plugin_id,
| p.name,
| p.owner_name,
Function writeProjects
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
): IO[Seq[(Model[Project], JsObject)]] = {
val projectIds = projects.map(_._1.id.value)
val versionIds = projects.map(_._2.id.value)
for {
Function toString
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
created_at: LocalDateTime,
name: String,
dependencies: List[VersionDependency],
visibility: Visibility,
description: Option[String],