fairplaysk/datacamp

View on GitHub

Showing 277 of 350 total issues

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

/*!
 * jQuery JavaScript Library v1.4.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
Severity: Major
Found in app/assets/javascripts/jquery.js - About 2 wks to fix

    Method suppliers_information has a Cognitive Complexity of 300 (exceeds 5 allowed). Consider refactoring.
    Open

          def suppliers_information
            suppliers = []
    
            case document_format
              when :format1
    Severity: Minor
    Found in lib/etl/vvo_v2/suppliers_information_parser.rb - About 6 days 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 contract_information has a Cognitive Complexity of 273 (exceeds 5 allowed). Consider refactoring.
    Open

          def contract_information
            contract_information_hash = {}
    
            case document_format
              when :format1
    Severity: Minor
    Found in lib/etl/vvo_v2/contract_information_parser.rb - About 5 days 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 suppliers_information has a Cognitive Complexity of 185 (exceeds 5 allowed). Consider refactoring.
    Open

        def suppliers_information(document)
          suppliers = []
    
          case document_type(document)
            when :standard
    Severity: Minor
    Found in lib/etl/vvo_extraction.rb - About 3 days 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 procedure_information has a Cognitive Complexity of 175 (exceeds 5 allowed). Consider refactoring.
    Open

          def procedure_information
            procedure_information_hash = {}
    
            case document_format
              when :format1
    Severity: Minor
    Found in lib/etl/vvo_v2/procedure_information_parser.rb - About 3 days 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 jQuery has 548 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var jQuery = (function() {
    
    // Define a local copy of jQuery
    var jQuery = function( selector, context ) {
            // The jQuery object is actually just the init constructor 'enhanced'
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 2 days to fix

      Method performance_information has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
      Open

            def performance_information
              performance_information_hash = {}
      
              case document_format
                when :format1
      Severity: Minor
      Found in lib/etl/vvo_v2/performance_information_parser.rb - About 2 days 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 additional_information has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
      Open

            def additional_information
              additional_information_hash = {}
      
              case document_format
                when :format1
      Severity: Minor
      Found in lib/etl/vvo_v2/additional_information_parser.rb - About 2 days 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 customer_information has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
      Open

            def customer_information
              customer_information_hash = {}
      
              case document_format
                when :format1
      Severity: Minor
      Found in lib/etl/vvo_v2/customer_information_parser.rb - About 2 days 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 show has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

        def show
          @dataset_description = DatasetDescription.find(params[:id])
          @field_descriptions  = @dataset_description.visible_field_descriptions.includes(:data_format)
          @dataset_class       = @dataset_description.dataset_model
          @title               = @dataset_description.title
      Severity: Minor
      Found in app/controllers/datasets_controller.rb - About 1 day 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 asmSelect has 247 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.asmSelect = function(customOptions) {
      
              var options = {
      
                  listType: 'ol',                        // Ordered list 'ol', or unordered list 'ul'
      Severity: Major
      Found in app/assets/javascripts/jquery.asmselect.js - About 1 day to fix

        Method suppliers_information has 242 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def suppliers_information
                suppliers = []
        
                case document_format
                  when :format1
        Severity: Major
        Found in lib/etl/vvo_v2/suppliers_information_parser.rb - About 1 day to fix

          Method contract_information has 219 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def contract_information
                  contract_information_hash = {}
          
                  case document_format
                    when :format1
          Severity: Major
          Found in lib/etl/vvo_v2/contract_information_parser.rb - About 1 day to fix

            Function ajax has 193 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                ajax: function( origSettings ) {
                    var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
                        jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
            
                    s.url = s.url.replace( rhash, "" );
            Severity: Major
            Found in app/assets/javascripts/jquery.js - About 7 hrs to fix

              Method get_formatted_value has a Cognitive Complexity of 45 (exceeds 5 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 6 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 tooltip has 164 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.tooltip = function(instanceSettings){
                      
                      $.fn.tooltip.defaultsSettings = {
                          attributeName:'title',
                          borderColor:'#ccc',
              Severity: Major
              Found in app/assets/javascripts/jquery.tooltip.js - About 6 hrs to fix

                Method performance_information has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def performance_information
                        performance_information_hash = {}
                
                        case document_format
                          when :format1
                Severity: Major
                Found in lib/etl/vvo_v2/performance_information_parser.rb - About 5 hrs to fix

                  Method procedure_information has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def procedure_information
                          procedure_information_hash = {}
                  
                          case document_format
                            when :format1
                  Severity: Major
                  Found in lib/etl/vvo_v2/procedure_information_parser.rb - About 5 hrs to fix

                    Method set_up_relation has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def set_up_relation
                          dataset_description.relations(true).each do |relation|
                    
                            left_association = (relation.relationship_dataset_description.identifier < dataset_description.identifier)
                            if relation.respond_to?(:morph) && relation.morph?
                    Severity: Minor
                    Found in app/models/dataset/model_builder.rb - About 5 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 create_predicates_from_tokens has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def create_predicates_from_tokens(tokens)
                        # puts "==> predicate from tokens #{tokens}"
                    
                        tokens.each { |token|
                            # puts "--- token '#{token}'"
                    Severity: Minor
                    Found in app/models/search_query.rb - About 5 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

                    Severity
                    Category
                    Status
                    Source
                    Language