Showing 6,062 of 6,062 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else {
pixelTotal = this.elementSize.height;
pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
}
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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 4 locations. Consider refactoring. Open
sw: function(event, dx, dy) {
return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
},
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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
if ( this.orientation === "horizontal" ) {
pixelTotal = this.elementSize.width;
pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 63.
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 drop
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
drop: function(event, ui) {
var $group = $(event.target);
var $node = $(ui.draggable.context);
var inserted = $.map(
- Create a ticketCreate a ticket
Function style
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
- Create a ticketCreate a ticket
Function fromTextArea
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
CodeMirror.fromTextArea = function(textarea, options) {
if (!options) options = {};
options.value = textarea.value;
if (!options.tabindex && textarea.tabindex)
options.tabindex = textarea.tabindex;
- Create a ticketCreate a ticket
Function drop
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
drop: function(event, ui) {
var $group = $(event.target);
var $node = $(ui.draggable.context);
var inserted = $.map(
- Create a ticketCreate a ticket
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css( elem, "position" ),
curElem = jQuery( elem ),
props = {};
- Create a ticketCreate a ticket
Function cleanData
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
- Create a ticketCreate a ticket
Function start
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var element, p, co, ch, cw, width, height,
that = $(this).data("ui-resizable"),
o = that.options,
el = that.element,
- Create a ticketCreate a ticket
Function _position
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_position: function() {
var position = this.options.position,
myAt = [],
offset = [ 0, 0 ],
isVisible;
- Create a ticketCreate a ticket
Function duplicateEntry
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
DynamicTable.prototype.duplicateEntry = function() {
if (this.options.key == false) {
return false;
}
- Create a ticketCreate a ticket
Function simpledraw
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.simpledraw = function (width, height, useExisting, interact) {
var target, mhandler;
if (useExisting && (target = this.data('_jqs_vcanvas'))) {
return target;
}
- Create a ticketCreate a ticket
Function _create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
var that = this,
options = this.options;
this.running = false;
- Create a ticketCreate a ticket
Function _eventHandler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_eventHandler: function( event ) {
var options = this.options,
active = this.active,
anchor = $( event.currentTarget ),
tab = anchor.closest( "li" ),
- Create a ticketCreate a ticket
Function _slide
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_slide: function( event, index, newVal ) {
var otherVal,
newValues,
allowed;
- Create a ticketCreate a ticket
Function getResizedImage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
getResizedImage: function (image, type, pid, ind) {
var self = this, width = image.naturalWidth, height = image.naturalHeight, ratio = 1,
maxWidth = self.maxImageWidth || width, maxHeight = self.maxImageHeight || height,
isValidImage = (width && height), chkWidth, chkHeight,
canvas = self.imageCanvas, context = self.imageCanvasContext;
- Create a ticketCreate a ticket
Method validate_proposal_constraints
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_proposal_constraints(proposal)
elements = proposal["deployment"][@bc_name]["elements"]
nodes_is_admin = {}
role_constraints.keys.each do |role|
- Create a ticketCreate a ticket
Method proposal_show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def proposal_show
code, message = @service_object.proposal_show(
params[:id]
)
- Create a ticketCreate a ticket
Similar blocks of code found in 4 locations. Consider refactoring. Open
if(event.pageX - this.offset.click.left < containment[0]) {
pageX = containment[0] + this.offset.click.left;
}
- Read upRead up
- Create a ticketCreate a ticket
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 62.
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