fairplaysk/datacamp

View on GitHub

Showing 350 of 350 total issues

Function html has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    html: function( value ) {
        if ( value === undefined ) {
            return this[0] && this[0].nodeType === 1 ?
                this[0].innerHTML.replace(rinlinejQuery, "") :
                null;
Severity: Minor
Found in app/assets/javascripts/jquery.js - About 1 hr to fix

    Function cleanData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        cleanData: function( elems ) {
            var data, id, cache = jQuery.cache,
                special = jQuery.event.special,
                deleteExpando = jQuery.support.deleteExpando;
            
    Severity: Minor
    Found in app/assets/javascripts/jquery.js - About 1 hr to fix

      Method searched_datasets has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def searched_datasets
          datasets = DatasetDescription.where(:is_active => true)
          
          Rails.logger.info "search: find datasets"
      
      
      Severity: Minor
      Found in app/models/search_query.rb - About 1 hr to fix

        Function addClass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            addClass: function( value ) {
                if ( jQuery.isFunction(value) ) {
                    return this.each(function(i) {
                        var self = jQuery(this);
                        self.addClass( value.call(this, i, self.attr("class")) );
        Severity: Minor
        Found in app/assets/javascripts/jquery.js - About 1 hr to fix

          Method parse_address has 27 lines of code (exceeds 25 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

            Method digest_founders has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def digest_founders(table)
                    founders = []
                    table.xpath(".//tr").each do |founder_row|
                      founder_identification = founder_row.xpath(".//td[1]").inner_text.strip.split("\n")
                      founder_contribution = founder_row.xpath(".//td[3]").inner_text[1..-2].strip.split(' ')
            Severity: Minor
            Found in lib/etl/foundation_extraction.rb - About 1 hr to fix

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

                      if ( jQuery.isFunction( html ) ) {
                          return this.each(function(i) {
                              jQuery(this).wrapAll( html.call(this, i) );
                          });
                      }
              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 4701..4705

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

              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( html ) ) {
                          return this.each(function(i) {
                              jQuery(this).wrapInner( html.call(this, i) );
                          });
                      }
              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 4672..4676

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

              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

                                supplier[:vat_included] = !code.inner_text.match(/Hodnota udelených (cien|ocenení) a\/alebo odmien(.*)(.)DPH/)[2].downcase.match(/bez/)
              
                                prices = code.xpath(".//span[@class='hodnota']")
                                supplier[:price] = prices[0].inner_text.gsub(' ', '').gsub(',', '.').to_f
                                supplier[:currency] = if prices[1].inner_text.downcase.match(/sk|skk/) then
              Severity: Major
              Found in lib/etl/vvo_extraction.rb and 1 other location - About 1 hr to fix
              lib/etl/vvo_extraction.rb on lines 157..166

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

              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

                                  supplier[:vat_included] = !price_detail.inner_text.match(/Hodnota udelených (cien|ocenení) a\/alebo odmien(.*)(.)DPH/)[2].downcase.match(/bez/)
              
                                  prices = price_detail.xpath(".//span")
                                  supplier[:price] = prices[0].inner_text.gsub(' ', '').gsub(',', '.').to_f
                                  supplier[:currency] = if prices[1].inner_text.downcase.match(/sk|skk/) then
              Severity: Major
              Found in lib/etl/vvo_extraction.rb and 1 other location - About 1 hr to fix
              lib/etl/vvo_extraction.rb on lines 224..233

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

              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 toggleClass has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  toggleClass: function( value, stateVal ) {
                      var type = typeof value,
                          isBool = typeof stateVal === "boolean";
              
                      if ( jQuery.isFunction( value ) ) {
              Severity: Minor
              Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                Function type has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    jQuery.fn[ type ] = function( size ) {
                        // Get window width or height
                        var elem = this[0];
                        if ( !elem ) {
                            return size == null ? null : this;
                Severity: Minor
                Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                  Function > has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          ">": function( checkSet, part ) {
                              var elem,
                                  isPartStr = typeof part === "string",
                                  i = 0,
                                  l = checkSet.length;
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.js - About 1 hr to fix

                    Method create_resources has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def create_resources(resource_type, resources, attributes)
                          all_ids = resources.map(&:_record_id)
                          active_objects = []
                          attributes.each do |obj_hash|
                            case resource_type
                    Severity: Minor
                    Found in lib/etl/foundation_extraction.rb - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
                              !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
                      
                              cacheable = true;
                              cacheresults = jQuery.fragments[ args[0] ];
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js - About 1 hr to fix

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

                                    }else if(p.x + p.w > v.x + v.w){
                                        p.x = p.x - (((p.x+p.w)-(v.x+v.w)) + 20);
                                    }else if(p.y + p.h > v.y + v.h){
                                        p.y = p.y - (((p.y+p.h)-(v.y+v.h)) + 20);
                                    }
                        Severity: Major
                        Found in app/assets/javascripts/jquery.tooltip.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/jquery.tooltip.js on lines 68..70

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

                        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

                                    }else if(p.y + p.h > v.y + v.h){
                                        p.y = p.y - (((p.y+p.h)-(v.y+v.h)) + 20);
                                    }
                        Severity: Major
                        Found in app/assets/javascripts/jquery.tooltip.js and 1 other location - About 1 hr to fix
                        app/assets/javascripts/jquery.tooltip.js on lines 66..70

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

                        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

                        Identical blocks of code found in 3 locations. Consider refactoring.
                        Open

                            def download
                              if @parent_url.present? && @cookie.present? && @reset_url
                                Typhoeus::Request.get(@reset_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                                Typhoeus::Request.get(@parent_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                              end
                        Severity: Major
                        Found in lib/etl/lawyer_associate_extraction.rb and 2 other locations - About 1 hr to fix
                        lib/etl/lawyer_extraction.rb on lines 22..27
                        lib/etl/lawyer_partnership_extraction.rb on lines 13..18

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

                        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

                        Identical blocks of code found in 3 locations. Consider refactoring.
                        Open

                            def download
                              if @parent_url.present? && @cookie.present? && @reset_url
                                Typhoeus::Request.get(@reset_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                                Typhoeus::Request.get(@parent_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                              end
                        Severity: Major
                        Found in lib/etl/lawyer_partnership_extraction.rb and 2 other locations - About 1 hr to fix
                        lib/etl/lawyer_associate_extraction.rb on lines 13..18
                        lib/etl/lawyer_extraction.rb on lines 22..27

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

                        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

                        Identical blocks of code found in 3 locations. Consider refactoring.
                        Open

                            def download
                              if @parent_url.present? && @cookie.present? && @reset_url
                                Typhoeus::Request.get(@reset_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                                Typhoeus::Request.get(@parent_url, headers: {'Cookie' => @cookie}, ssl_verifypeer: false)
                              end
                        Severity: Major
                        Found in lib/etl/lawyer_extraction.rb and 2 other locations - About 1 hr to fix
                        lib/etl/lawyer_associate_extraction.rb on lines 13..18
                        lib/etl/lawyer_partnership_extraction.rb on lines 13..18

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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language