Showing 3,486 of 3,486 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
onShow : function(){
Ext.ToolTip.superclass.onShow.call(this);
Ext.getDoc().on('mousedown', this.onDocMouseDown, this);
},
- 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 59.
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
yAxis: {
color: 0x69aBc8,
majorTicks: {color: 0x69aBc8, length: 4},
minorTicks: {color: 0x69aBc8, length: 2},
majorGridLines: {size: 1, color: 0xdfe8f6}
- 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 59.
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 handler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function(b, e) {
Ext.Ajax.request({
url: this['approve_url'],
scope: b,
success: function(response, opts) {
Function handler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function(b, e) {
Ext.Ajax.request({
url: this['deny_url'],
scope: b,
success: function(response, opts) {
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(config){
Ext.apply(this, config);
// Add flash msg at top and buttons at the bottom
var panel_items = [
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(config){
this.roles_control = new Talho.ux.RolesControl(config.url + ".json", this);
this.infobox = new Ext.Container({
layout: 'column',
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(config){
this.orgs_control = new Talho.ux.OrganizationsControl(config.url + ".json", this);
this.infobox = new Ext.Container({
layout: 'column',
Function applyTemplate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
applyTemplate : function(values){
var me = this,
useF = me.disableFormats !== true,
fm = Ext.util.Format,
tpl = me;
Function scrollIntoView
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
scrollIntoView : function(container, hscroll) {
var c = Ext.getDom(container) || Ext.getBody().dom,
el = this.dom,
o = this.getOffsetsTo(c),
l = o[0] + c.scrollLeft,
Function sort
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
sort : function(fieldName, dir) {
if (this.remoteSort) {
return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir);
}
Function onNodeOver
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onNodeOver : function(n, dd, e, data){
var pt = this.getDropPoint(e, n, dd);
var node = n.node;
// auto node expand check
Function initEvents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
initEvents : function(){
Ext.form.TextField.superclass.initEvents.call(this);
if(this.validationEvent == 'keyup'){
this.validationTask = new Ext.util.DelayedTask(this.validate, this);
this.mon(this.el, 'keyup', this.filterValidation, this);
Function onMonthClick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMonthClick : function(e, t){
e.stopEvent();
var el = new Ext.Element(t), pn;
if(el.is('button.x-date-mp-cancel')){
this.hideMonthPicker();
Function setContainer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setContainer : function(ct){
Ext.layout.FormLayout.superclass.setContainer.call(this, ct);
if(ct.labelAlign){
ct.addClass('x-form-label-'+ct.labelAlign);
}
Function getTemplate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getTemplate : function() {
return [
'<div id="ux-lightbox">',
'<div id="ux-lightbox-outerImageContainer">',
'<div id="ux-lightbox-imageContainer">',
Function initMarkup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
initMarkup: function() {
var dh = Ext.DomHelper;
this.carouselSize = 0;
var items = this.el.select(this.itemSelector);
Function createResponseObject
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createResponseObject(o, callbackArg) {
var headerObj = {},
headerStr,
conn = o.conn,
t,
Function setEvent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setEvent : function(e){
var me = this;
if(e == me || (e && e.browserEvent)){ // already wrapped
return e;
}
Function setRunAttr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setRunAttr: function(attr) {
var me = this,
a = this.attributes[attr],
to = a.to,
by = a.by,
Function garbageCollect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function garbageCollect(){
if(!Ext.enableGarbageCollector){
clearInterval(El.collectorThreadId);
} else {
var eid,