Showing 277 of 350 total issues
Function animate
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete );
File inscription.js
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
// inscription.js
// jQuery-based javascript toolking
// (c) Vojto Rinik
Method digest
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def digest(doc)
employees = []
doc.xpath("//div[@id='dnn_ctr730_ModuleContent']/div[@class='TableFontItem']/table[@class='NuDetailTable']//div[@class='TableFontItem']/table[@class='NuDetailTable']/tr").each do |employee|
next if employee.xpath('.//td[1]').inner_text =~ /Meno|Deň|Pondelok|Utorok|Streda|Štvrtok|Piatok/
employee_name = employee.xpath('.//td[1]').inner_text
- 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 filter
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Sizzle.filter = function( expr, set, inplace, not ) {
var match, anyFound,
old = expr,
result = [],
curLoop = set,
Function val
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
val: function( value ) {
if ( !arguments.length ) {
var elem = this[0];
if ( elem ) {
Function init
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( selector, context ) {
var match, elem, ret, doc;
// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
Method foundation
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def foundation
registration_number = identification_number = name = address = objective = ''
date_start = date_end = date_liquidation = date_registration = ''
assets_value = assets_currency = nil
Function liveHandler
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function liveHandler( event ) {
var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
elems = [],
selectors = [],
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
Function attr
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
attr: function( elem, name, value, pass ) {
// don't set attributes on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
return undefined;
}
Function clean
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
clean: function( elems, context, fragment, scripts ) {
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
Method update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def update
@dataset_description = DatasetDescription.find_by_id(params[:id])
@dataset_class = @dataset_description.dataset_model
if params[:record].blank?
- 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
Class DatasetRecord
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Dataset::DatasetRecord < ActiveRecord::Base
include ActionView::Helpers::NumberHelper
include ActionView::Helpers::TextHelper
self.abstract_class = true
Method save
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def save
procurement_digest = digest
# TODO refactor
case dataset_type
- 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 offset
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.offset = function( options ) {
var elem = this[0];
if ( options ) {
return this.each(function( i ) {
Class Generator
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Generator
attr_reader :locale, :locale_path
def initialize(locale, locale_path)
Method page_entries_info_custom
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def page_entries_info_custom(collection, options = {})
model = options[:model]
model = collection.first.class unless model or collection.empty?
model ||= 'entry'
model_key = if model.respond_to? :model_name
Method update_source_url_and_document_id
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.update_source_url_and_document_id(sta_procurement, all_bulletins)
key = "#{sta_procurement.bulletin_id}/#{sta_procurement.year}"
url = all_bulletins[key]
document = Nokogiri::HTML(Typhoeus::Request.get(url).body)
- 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 digest
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def digest(doc)
ico = name = legal_form = date_start = date_end = address = region = ''
doc.xpath("//table[@class='tabid']//tr").each do |row|
if row.xpath(".//td[1]").inner_text.match(/i(Č|č|c)o/i)
ico = row.xpath(".//td[3]").inner_text
- 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 add_to_sphinx_search
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_to_sphinx_search(operand, sphinx_search)
options = {with: {}, without: {}}
operand ||= "*"
case operator
Function on
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function on(e){
$('body').append('<div id="'+s.tooltipID+'" style="background-repeat:no-repeat;background-image:url('+s.tooltipBGImage+');padding:'+s.tooltipPadding+'px;display:none;height:'+s.height+';width:'+s.width+';background-color:'+s.tooltipBGColor+';border:'+s.borderSize+'px solid '+s.borderColor+'; position:absolute;z-index:100000000000;"><div id="tooltipContent" style="display:none;"></div></div>');
var $tt = $('#'+s.tooltipID);