fairplaysk/datacamp

View on GitHub

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

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

                                    if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
                                        this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
                                    else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
                                        this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
                Severity: Major
                Found in app/assets/javascripts/jquery.ui.nestedSortable.js and 1 other location - About 6 hrs to fix
                app/assets/javascripts/jquery.ui.nestedSortable.js on lines 50..53

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

                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((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
                                        this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
                                    else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
                                        this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
                Severity: Major
                Found in app/assets/javascripts/jquery.ui.nestedSortable.js and 1 other location - About 6 hrs to fix
                app/assets/javascripts/jquery.ui.nestedSortable.js on lines 55..58

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

                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(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
                                        scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
                                    else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
                                        scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
                Severity: Major
                Found in app/assets/javascripts/jquery.ui.nestedSortable.js and 1 other location - About 5 hrs to fix
                app/assets/javascripts/jquery.ui.nestedSortable.js on lines 67..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 154.

                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(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
                                        scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
                                    else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
                                        scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
                Severity: Major
                Found in app/assets/javascripts/jquery.ui.nestedSortable.js and 1 other location - About 5 hrs to fix
                app/assets/javascripts/jquery.ui.nestedSortable.js on lines 62..65

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

                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