Showing 3,486 of 3,486 total issues
Method perform
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
report_id = params[:report_id]
logger = REPORT_LOGGER || Logger.new
begin
begin
File ext-lang-pt_PT.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-fi.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-el_GR.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-tr.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
File ext-lang-hu.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
Identical blocks of code found in 2 locations. Consider refactoring. Open
post: function( url, data, callback, type ) {
if ( jQuery.isFunction( data ) ) {
callback = data;
data = {};
}
- 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 81.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
post: function( url, data, callback, type ) {
if ( jQuery.isFunction( data ) ) {
callback = data;
data = {};
}
- 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 81.
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
File ext-lang-pt_BR.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
Function initComponent
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent: function(){
this.setTitle(this.editMode ? 'Edit Forum' : 'New Forum');
this.items = [
{xtype: 'container', itemId: 'container', width: 350, layout: 'form', defaults: {anchor: '100%'}, items: [
{xtype: 'textfield', fieldLabel: 'Forum Name', name:'forum[name]', allowBlank: false},
Function initComponent
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComponent : function(){
Ext.tree.TreePanel.superclass.initComponent.call(this);
if(!this.eventModel){
this.eventModel = new Ext.tree.TreeEventModel(this);
Function frame
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
frame : function(color, count, o){
o = getObject(o);
var me = this,
dom = me.dom,
proxy,
Function getXY
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
getXY : function(el) {
var p,
pe,
b,
bt,
Function doRender
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
doRender : function(cs, rs, ds, startRow, colCount, stripe)
{
var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1;
var tstyle = 'width:'+this.getTotalWidth()+';';
// buffers
Function doRender
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
doRender : function(cs, rs, ds, startRow, colCount, stripe)
{
var ts = this.templates, ct = ts.cell, rt = ts.row, last = colCount-1;
var tstyle = 'width:'+this.getTotalWidth()+';';
// buffers
Function getXY
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
getXY : function(el) {
var p,
pe,
b,
bt,
Function panelLoaded
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
panelLoaded: function(panel){
var link_elem_style = {'margin-bottom': '15px'};
var wildcard_explanation = panel.getEl().select('.search_user_explanation').first();
if(wildcard_explanation)
Method import_users
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.import_users(filename, options={})
options = {:col_sep => ",", :row_sep => :auto, :update => false, :create => true,
:default_jurisdiction => nil, :default_password => self.generate_random_password}.merge(options)
CSV.open(filename, :headers => true, :col_sep => options[:col_sep], :row_sep => options[:row_sep]) do |records|
records.each do |rec|
Function initComponent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
initComponent : function() {
this.setTitle('Topic: '+ this.topicName);
if(!this.items) {
this.items = [];
- 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 execute
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
execute : function(action, rs, options, /* private */ batch) {
// blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY
if (!Ext.data.Api.isAction(action)) {
throw new Ext.data.Api.Error('execute', action);
}
- 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"