fairplaysk/datacamp

View on GitHub

Showing 277 of 350 total issues

Function init_tabs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var init_tabs = function(){
  $("ul.tabs").each(function(){
    // Add init class
    if($(this).hasClass('initialized'))
    {
Severity: Major
Found in app/assets/javascripts/inscription.js - About 2 hrs to fix

    File jquery.asmselect.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Alternate Select Multiple (asmSelect) 1.0.4a beta - jQuery Plugin
     * http://www.ryancramer.com/projects/asmselect/
     * 
     * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com
    Severity: Minor
    Found in app/assets/javascripts/jquery.asmselect.js - About 2 hrs to fix

      Function modal has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      $.modal = function(options){
        inscription_modal_remove();
        
        options = $.extend({
          position: 'center',
      Severity: Minor
      Found in app/assets/javascripts/inscription.js - About 2 hrs to fix

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

          Method parse has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

                def self.parse(html, year)
                  ::Parsers::Support.save(parse_location(year), 'csv', bucketize: false)
                  CSV.open(::Parsers::Support.get_path(parse_location(year), bucketize: false), "wb", force_quotes: true) do |csv|
                    csv << ATTRIBUTES
          
          
          Severity: Minor
          Found in app/models/parsers/donations_parser/parser.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 record_changes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

            def record_changes
              if !self.class.table_name.match(/^(rel_|dc_)/) && !is_part_of_import
                change_details = []
                changed_attributes.each do |attribute, old_value|
                  next if attribute == "updated_at"
          Severity: Minor
          Found in app/models/dataset/dataset_record.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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              def digest(doc)
                lawyer_table = doc.xpath("//div[@class='section']/table[@class='filter']").first
          
                original_name = lawyer_table.xpath('./tr[1]/td[2]').inner_text.strip
                name_ary = original_name.split
          Severity: Minor
          Found in lib/etl/lawyer_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 save has 47 lines of code (exceeds 25 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 1 hr to fix

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

                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 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 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 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 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
                                Severity
                                Category
                                Status
                                Source
                                Language