Showing 518 of 518 total issues
Function createProjectTopic
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def createProjectTopic(project: Model[Project]): F[Model[Project]] = {
val title = Templates.projectTitle(project)
implicit val mdc: DiscourseMDC = DiscourseMDC(project.ownerName, None, title)
Similar blocks of code found in 2 locations. Consider refactoring. Open
package ore.db.impl.schema
import ore.db.DbRef
import ore.db.impl.OrePostgresDriver.api._
import ore.db.impl.table.common.RoleTable
- 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 123.
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
package ore.db.impl.schema
import ore.db.DbRef
import ore.db.impl.OrePostgresDriver.api._
import ore.db.impl.table.common.RoleTable
- 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 123.
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 initChannelManager
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initChannelManager(toggle, channelName, channelHex, title, call, method, submit, nonReviewed) {
$(toggle).off('click'); // Unbind previous click handlers
$(toggle).click(function() {
var modal = getModal();
var preview = modal.find('.preview');
Function loadActions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadActions(increment, action) {
pages[action] += increment;
var offset = (pages[action] - 1) * CONTENT_PER_PAGE;
apiV2Request('users/' + USERNAME + '/' + action + '?offset=' + offset + '&limit=' + CONTENT_PER_PAGE).then(function (result) {
Function diff_main
has 38 lines of code (exceeds 25 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) {
Function activate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
Function initUserSearch
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initUserSearch(callback) {
var search = $('.user-search');
var input = search.find('input');
// Disable button with no input
Function patch_addPadding
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_addPadding = function(patches) {
var paddingLength = this.Patch_Margin;
var nullPadding = '';
for (var x = 1; x <= paddingLength; x++) {
nullPadding += String.fromCharCode(x);
Function getQueue
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
val getQueue: Query0[UnsortedQueueEntry] = {
val reviewStateId = ReviewState.Unreviewed.value
sql"""|SELECT sq.project_author,
| sq.project_slug,
| sq.project_name,
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 =>
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)
Constructor has 12 arguments (exceeds 4 allowed). Consider refactoring. 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
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
): 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
): EitherT[IO, String, (Project, ProjectSettings)] = {
val name = template.name
val slug = slugify(name)
val project = Project(
pluginId = template.pluginId,
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
- 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 64.
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 3 locations. Consider refactoring. Open
if (!self) {
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
$(obj.currentTarget).data('bs.' + this.type, self)
}
- 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 64.
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 3 locations. Consider refactoring. Open
if (!self) {
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
$(e.currentTarget).data('bs.' + this.type, self)
}
- 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 64.
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 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({