fairplaysk/datacamp

View on GitHub

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 );
Severity: Major
Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

    File inscription.js has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // 
    // inscription.js
    // jQuery-based javascript toolking
    // (c) Vojto Rinik
    
    
    Severity: Minor
    Found in app/assets/javascripts/inscription.js - About 2 hrs to fix

      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
      Severity: Minor
      Found in lib/etl/notar_extraction.rb - About 2 hrs to fix

      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,
      Severity: Major
      Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

        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 ) {
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

          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 ) {
          Severity: Major
          Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

            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
            
            
            Severity: Major
            Found in lib/etl/foundation_extraction.rb - About 2 hrs to fix

              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__" );
              Severity: Major
              Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                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;
                        }
                Severity: Major
                Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                  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" ) {
                  Severity: Major
                  Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                    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?
                    Severity: Minor
                    Found in app/controllers/datasets_controller.rb - About 2 hrs to fix

                    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
                    Severity: Minor
                    Found in app/models/dataset/dataset_record.rb - About 2 hrs to fix

                      Method save has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def save
                            procurement_digest = digest
                      
                            # TODO refactor
                            case dataset_type
                      Severity: Minor
                      Found in lib/etl/vvo_extraction_v2.rb - About 2 hrs to fix

                      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 ) {
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js - About 2 hrs to fix

                        Class Generator has 21 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class Generator
                        
                            attr_reader :locale, :locale_path
                        
                            def initialize(locale, locale_path)
                        Severity: Minor
                        Found in lib/site_map_generator.rb - About 2 hrs to fix

                          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
                          Severity: Major
                          Found in app/helpers/i18n_helper.rb - About 2 hrs to fix

                            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)
                            Severity: Minor
                            Found in lib/etl/vvo_extraction.rb - About 2 hrs to fix

                            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
                            Severity: Minor
                            Found in lib/etl/regis_extraction_old.rb - About 2 hrs to fix

                            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
                            Severity: Major
                            Found in app/models/search_predicate.rb - About 2 hrs to fix

                              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);
                              Severity: Major
                              Found in app/assets/javascripts/jquery.tooltip.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language