fairplaysk/datacamp

View on GitHub

Showing 350 of 350 total issues

Method parse_for_links has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def parse_for_links(doc, reset_url, cookie, parent_url, filter)
Severity: Minor
Found in lib/etl/lawyer_extraction.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
    Severity: Minor
    Found in lib/etl/lawyer_extraction.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
      Severity: Minor
      Found in lib/etl/lawyer_associate_extraction.rb - About 35 mins to fix

        Method parse_for_links has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def parse_for_links(doc, reset_url, cookie, parent_url, filter)
        Severity: Minor
        Found in lib/etl/lawyer_partnership_extraction.rb - About 35 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def initialize(path, col_sep, encoding, skip_first_line = false, has_header = true)
          Severity: Minor
          Found in lib/csv_file.rb - About 35 mins to fix

            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def initialize(url, reset_url = nil, cookie = nil, parent_url = nil, filter = nil)
            Severity: Minor
            Found in lib/etl/lawyer_partnership_extraction.rb - About 35 mins to fix

              Method parse_for_links has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def parse_for_links(doc, reset_url, cookie, parent_url, filter)
              Severity: Minor
              Found in lib/etl/lawyer_associate_extraction.rb - About 35 mins to fix

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

                    {
                      $(o.tab).hide();
                      $(o.link).parent().removeClass('active');
                    };
                Severity: Minor
                Found in app/assets/javascripts/inscription.js and 1 other location - About 35 mins to fix
                app/assets/javascripts/inscription.js on lines 117..120

                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

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

                    {
                      $(o.tab).show();
                      $(o.link).parent().addClass('active');
                    }
                Severity: Minor
                Found in app/assets/javascripts/inscription.js and 1 other location - About 35 mins to fix
                app/assets/javascripts/inscription.js on lines 122..125

                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

                Method sort_link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def sort_link(field)
                    params[:dir] ||= "asc"
                    lab = html_escape(field.title).html_safe
                    lab += image_tag "sort_#{params["dir"]}.png" if params[:sort] == field.identifier
                
                
                Severity: Minor
                Found in app/helpers/datasets_helper.rb - About 35 mins 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 has_right? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def has_right?(right)
                    # Super-user has all the rights
                    return true if is_super_user
                
                    # Check for particular rights
                Severity: Minor
                Found in app/models/user.rb - About 35 mins 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 modal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                $.modal = function(options){
                  inscription_modal_remove();
                  
                  options = $.extend({
                    position: 'center',
                Severity: Minor
                Found in app/assets/javascripts/inscription.js - About 35 mins 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def update
                    @field_description = FieldDescription.find_by_id(params[:id])
                
                    respond_to do |format|
                      if @field_description.update_attributes(params[:field_description])
                Severity: Minor
                Found in app/controllers/field_descriptions_controller.rb - About 35 mins 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 dataset_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.dataset_type(document_type)
                      return nil unless document_type
                      if document_type.start_with?('V') || document_type.start_with?('IP')
                        :notice
                      elsif document_type.start_with?('IZ') || document_type.start_with?('ID')
                Severity: Minor
                Found in lib/etl/vvo_extraction_v2.rb - About 35 mins 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_all_downloaded_documents_for_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.parse_all_downloaded_documents_for_type(dataset_type)
                      ids = Dir.glob("data/#{Rails.env}/vvo/procurements/*/*.html").map { |n| File.basename(n, ".html").to_i }
                      ids.each_with_index do |document_id, index|
                        ext = Etl::VvoExtractionV2.new(document_id)
                        if ext.dataset_type == dataset_type
                Severity: Minor
                Found in lib/etl/vvo_extraction_v2.rb - About 35 mins 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

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

                                        price_value_element = next_price_value_element(price_element)
                                        if price_value_element
                                          price_hash = parse_price2(price_value_element)
                                          performance_information_hash[:procurement_currency] = price_hash[:currency]
                                          performance_information_hash[:final_price] = price_hash[:price]
                Severity: Major
                Found in lib/etl/vvo_v2/performance_information_parser.rb and 3 other locations - About 35 mins to fix
                lib/etl/vvo_v2/performance_information_parser.rb on lines 49..55
                lib/etl/vvo_v2/performance_information_parser.rb on lines 58..64
                lib/etl/vvo_v2/performance_information_parser.rb on lines 123..129

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

                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 4 locations. Consider refactoring.
                Open

                                        price_value_element = next_price_value_element(price_element)
                                        if price_value_element
                                          price_hash = parse_price1(price_value_element)
                                          performance_information_hash[:procurement_currency] = price_hash[:currency]
                                          performance_information_hash[:final_price] = price_hash[:price]
                Severity: Major
                Found in lib/etl/vvo_v2/performance_information_parser.rb and 3 other locations - About 35 mins to fix
                lib/etl/vvo_v2/performance_information_parser.rb on lines 49..55
                lib/etl/vvo_v2/performance_information_parser.rb on lines 123..129
                lib/etl/vvo_v2/performance_information_parser.rb on lines 132..138

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

                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 4 locations. Consider refactoring.
                Open

                                        price_value_element = next_price_value_element(price_element)
                                        if price_value_element
                                          price_hash = parse_price1(price_value_element)
                                          performance_information_hash[:procurement_currency] = price_hash[:currency]
                                          performance_information_hash[:draft_price] = price_hash[:price]
                Severity: Major
                Found in lib/etl/vvo_v2/performance_information_parser.rb and 3 other locations - About 35 mins to fix
                lib/etl/vvo_v2/performance_information_parser.rb on lines 58..64
                lib/etl/vvo_v2/performance_information_parser.rb on lines 123..129
                lib/etl/vvo_v2/performance_information_parser.rb on lines 132..138

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

                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 4 locations. Consider refactoring.
                Open

                                        price_value_element = next_price_value_element(price_element)
                                        if price_value_element
                                          price_hash = parse_price2(price_value_element)
                                          performance_information_hash[:procurement_currency] = price_hash[:currency]
                                          performance_information_hash[:draft_price] = price_hash[:price]
                Severity: Major
                Found in lib/etl/vvo_v2/performance_information_parser.rb and 3 other locations - About 35 mins to fix
                lib/etl/vvo_v2/performance_information_parser.rb on lines 49..55
                lib/etl/vvo_v2/performance_information_parser.rb on lines 58..64
                lib/etl/vvo_v2/performance_information_parser.rb on lines 132..138

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

                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

                Avoid too many return statements within this function.
                Open

                            return this.css( type, typeof size === "string" ? size : size + "px" );
                Severity: Major
                Found in app/assets/javascripts/jquery.js - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language