fairplaysk/datacamp

View on GitHub

Showing 350 of 350 total issues

Function domManip has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    domManip: function( args, table, callback ) {
        var results, first, fragment, parent,
            value = args[0],
            scripts = [];

Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

    Function closest has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        closest: function( selectors, context ) {
            var ret = [], i, l, cur = this[0];
    
            if ( jQuery.isArray( selectors ) ) {
                var match, selector,
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Function CHILD has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              CHILD: function( elem, match ) {
                  var type = match[1],
                      node = elem;
      
                  switch ( type ) {
      Severity: Minor
      Found in app/assets/javascripts/jquery.js - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if ( jQuery.isFunction( size ) ) {
                    return this.each(function( i ) {
                        var self = jQuery( this );
                        self[ type ]( size.call( this, i, self[ type ]() ) );
                    });
        Severity: Major
        Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.js on lines 4656..4662

        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 71.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if ( jQuery.isFunction(text) ) {
                    return this.each(function(i) {
                        var self = jQuery( this );
        
                        self.text( text.call(this, i, self.text()) );
        Severity: Major
        Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.js on lines 7142..7147

        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 71.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
        Severity: Major
        Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.js on lines 2318..2318

        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 71.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
        Severity: Major
        Found in app/assets/javascripts/jquery.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/jquery.js on lines 2319..2319

        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 71.

        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

        Further Reading

        Function onreadystatechange has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
                    // The request was aborted
                    if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
                        // Opera doesn't call onreadystatechange before this point
                        // so we simulate the call
        Severity: Minor
        Found in app/assets/javascripts/jquery.js - About 1 hr to fix

          Method parse_address has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

                def parse_address(full_address)
                  zip = place = ''
                  items = full_address.split(',')
                  if items.size < 3
                    address = items[0]
          Severity: Minor
          Found in lib/etl/shared/vvo_includes.rb - About 1 hr 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 perform has a Cognitive Complexity of 14 (exceeds 5 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|
          Severity: Minor
          Found in lib/etl/vvo_bulletin_extraction.rb - About 1 hr 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 43 lines of code (exceeds 25 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 1 hr to fix

            Function name has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
                    var type, i = 0, match, namespaces, preType,
                        selector = origSelector || this.selector,
                        context = origSelector ? this : jQuery( this.context );
                    
            Severity: Minor
            Found in app/assets/javascripts/jquery.js - About 1 hr to fix

              Method sql_condition_for_operand has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def sql_condition_for_operand(operand)
                  sql_argument = argument
                  operand = "(#{operand})"
                  
                  case operator
              Severity: Minor
              Found in app/models/search_predicate.rb - About 1 hr to fix

                Function handle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    handle: function( event ) {
                        var all, handlers, namespaces, namespace_re, events,
                            namespace_sort = [],
                            args = jQuery.makeArray( arguments );
                
                
                Severity: Minor
                Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                  Method header_procedure_and_project_information has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def header_procedure_and_project_information
                          header_procedure_and_project_information_hash = {}
                          main_element = document.xpath("//div[@class='oznamenie']")
                  
                          case document_format
                  Severity: Minor
                  Found in lib/etl/vvo_v2/basic_information_parser.rb - About 1 hr to fix

                    Function load has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        load: function( url, params, callback ) {
                            if ( typeof url !== "string" && _load ) {
                                return _load.apply( this, arguments );
                    
                            // Don't do a request if no elements are being requested
                    Severity: Minor
                    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                      Method get_formatted_value has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def get_formatted_value(field_description)
                          value = get_value(field_description)
                          # Apply format
                          data_format = field_description.data_format
                          if data_format
                      Severity: Minor
                      Found in app/models/dataset/dataset_record.rb - About 1 hr to fix

                        Function extend has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jQuery.extend = jQuery.fn.extend = function() {
                             var options, name, src, copy, copyIsArray, clone,
                                target = arguments[0] || {},
                                i = 1,
                                length = arguments.length,
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                          Function step has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              step: function( gotoEnd ) {
                                  var t = jQuery.now(), done = true;
                          
                                  if ( gotoEnd || t >= this.options.duration + this.startTime ) {
                                      this.now = this.end;
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                            Method parse_price1 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                            Open

                                  def parse_price1(price_element)
                                    price_hash = {}
                                    if price_element.xpath(".//span").size == 1
                                      price_hash[:price] = parse_float(price_element.xpath(".//span[1]").inner_text.strip)
                                      price_hash[:price_interval] = false
                            Severity: Minor
                            Found in lib/etl/vvo_v2/parser_includes.rb - About 1 hr 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

                            Severity
                            Category
                            Status
                            Source
                            Language