Showing 350 of 350 total issues
Method digest_attributes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def digest_attributes
case dataset_type
when :notice
[
# Basic information
Function init_tabs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var init_tabs = function(){
$("ul.tabs").each(function(){
// Add init class
if($(this).hasClass('initialized'))
{
- 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
Method error
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def error code, info = {}
error = @@errors[code.to_sym]
if error.nil?
error = @@errors[:internal_inconsistency]
@message = "Unknown error code '#{code}'"
- 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
Method set_up_relation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_up_relation
dataset_description.relations(true).each do |relation|
left_association = (relation.relationship_dataset_description.identifier < dataset_description.identifier)
if relation.respond_to?(:morph) && relation.morph?
Function callRemote
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
callRemote: function () {
var el = this,
method = el.attr('method') || el.attr('data-method') || 'GET',
url = el.attr('action') || el.attr('href'),
dataType = el.attr('data-type') || ($.ajaxSettings && $.ajaxSettings.dataType);
Function data
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: function( elem, name, data ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Method parse_recipient_2013
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_recipient_2013(td)
proposal = {}
e = td.css('span.cervene').first
return proposal unless e
proposal[:name] = clean_string(e.text)
Method perform
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
document_ids = []
css_links = document.css('#layout-column_column-2 .portlet-body a')
any_valid_link = false
css_links.each do |css_link|
Function dirCheck
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
Function removeData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeData: function( elem, name ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function each
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction(object);
Function cookie
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
Function offset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
if ( options ) {
return this.each(function( i ) {
Function setOffset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
Function init_search
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var init_search = function(row, reset){
row.find(".remove_row").click(function(){
row.remove();
return false;
Function ATTR
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ATTR: function( elem, match ) {
var name = match[1],
result = Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
Method parse_recipient_2007_2012
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_recipient_2007_2012(td)
proposal = {}
e = td.css('span.cervene').first
return proposal unless e
proposal[:name] = clean_string(e.text)
Method contract_information
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def contract_information(document)
contract_information_hash = {}
case document_type(document)
when :standard
Method save
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save(procurement_hash)
# Empty suppliers - notification
if procurement_hash[:suppliers].empty?
update_report_object_depth_2(:download_procurement, :empty_suppliers, id, document_url(id))
Method initialize_dataset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.initialize_dataset(dataset_name, debug_output=false)
unless DatasetDescription.where(identifier: dataset_name).exists?
puts "initializing #{dataset_name}" if debug_output
result = Dataset::TableToDataset.execute("ds_#{dataset_name}", dataset_name)
if result.valid?
- 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"