fairplaysk/datacamp

View on GitHub

Showing 277 of 350 total issues

Method customer_information has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def customer_information
        customer_information_hash = {}

        case document_format
          when :format1
Severity: Major
Found in lib/etl/vvo_v2/customer_information_parser.rb - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if ( event.pageX == null && event.clientX != null ) {
                var doc = document.documentElement,
                    body = document.body;
    
                event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
    Severity: Critical
    Found in app/assets/javascripts/jquery.js - About 4 hrs to fix

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

          def suppliers_information(document)
            suppliers = []
      
            case document_type(document)
              when :standard
      Severity: Major
      Found in lib/etl/vvo_extraction.rb - About 4 hrs to fix

        Method header_procedure_and_project_information has a Cognitive Complexity of 30 (exceeds 5 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 4 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 Sizzle has 108 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Sizzle = function( selector, context, results, seed ) {
            results = results || [];
            context = context || document;
        
            var origContext = context;
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 4 hrs to fix

          File vvo_extraction.rb has 334 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'fileutils'
          
          module Etl
            class VvoExtraction < Etl::Extraction
              include Etl::Shared::VvoIncludes
          Severity: Minor
          Found in lib/etl/vvo_extraction.rb - About 4 hrs to fix

            Method show has 97 lines of code (exceeds 25 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: Major
            Found in app/controllers/datasets_controller.rb - About 3 hrs to fix

              Method page_entries_info_custom has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                def page_entries_info_custom(collection, options = {})
                  model = options[:model]
                  model = collection.first.class unless model or collection.empty?
                  model ||= 'entry'
                  model_key = if model.respond_to? :model_name
              Severity: Minor
              Found in app/helpers/i18n_helper.rb - About 3 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 remove has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  remove: function( elem, types, handler, pos ) {
                      // don't do events on text and comment nodes
                      if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
                          return;
                      }
              Severity: Major
              Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

                Method additional_information has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def additional_information
                        additional_information_hash = {}
                
                        case document_format
                          when :format1
                Severity: Major
                Found in lib/etl/vvo_v2/additional_information_parser.rb - About 3 hrs to fix

                  Function _mouseDrag has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _mouseDrag: function(event) {
                  
                              //Compute the helpers position
                              this.position = this._generatePosition(event);
                              this.positionAbs = this._convertPositionTo("absolute");
                  Severity: Major
                  Found in app/assets/javascripts/jquery.ui.nestedSortable.js - About 3 hrs to fix

                    Method define_index_for_dataset has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def self.define_index_for_dataset(dataset_description)
                        reference = dataset_description.dataset_model.name.underscore
                        ThinkingSphinx::Index.define(reference, with: :active_record) do
                          indexes :_record_id
                          indexes :record_status
                    Severity: Minor
                    Found in lib/sphinx_dataset_index.rb - About 3 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 perform has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def perform
                          document_ids = {
                              notice: [],
                              performance: []
                          }
                    Severity: Minor
                    Found in lib/etl/vvo_bulletin_extraction_v2.rb - About 3 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 add has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        add: function( elem, types, handler, data ) {
                            if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
                                return;
                            }
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

                      Method contract_information has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def contract_information(document)
                            contract_information_hash = {}
                      
                            case document_type(document)
                              when :standard
                      Severity: Minor
                      Found in lib/etl/vvo_extraction.rb - About 3 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

                      Class DatasetDescription has 27 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class DatasetDescription < ActiveRecord::Base
                        has_many :similar_datasets,
                                 source: :dataset_description_source,
                                 foreign_key: :similar_source_id
                      
                      
                      Severity: Minor
                      Found in app/models/dataset_description.rb - About 3 hrs to fix

                        Method foundation has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def foundation
                                registration_number = identification_number = name = address = objective = ''
                                date_start = date_end = date_liquidation = date_registration = ''
                                assets_value = assets_currency = nil
                        
                        
                        Severity: Minor
                        Found in lib/etl/foundation_extraction.rb - About 3 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

                        Consider simplifying this complex logical expression.
                        Open

                        if ( "getBoundingClientRect" in document.documentElement ) {
                            jQuery.fn.offset = function( options ) {
                                var elem = this[0], box;
                        
                                if ( options ) { 
                        Severity: Critical
                        Found in app/assets/javascripts/jquery.js - About 3 hrs to fix

                          Method create_predicates_from_tokens has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          def create_predicates_from_tokens(tokens)
                              # puts "==> predicate from tokens #{tokens}"
                          
                              tokens.each { |token|
                                  # puts "--- token '#{token}'"
                          Severity: Major
                          Found in app/models/search_query.rb - About 2 hrs to fix

                            Function trigger has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                trigger: function( event, data, elem /*, bubbling */ ) {
                                    // Event object or event type
                                    var type = event.type || event,
                                        bubbling = arguments[3];
                            
                            
                            Severity: Major
                            Found in app/assets/javascripts/jquery.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language