gooddata/gooddata-ruby

View on GitHub

Showing 359 of 407 total issues

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

        def call(params)
          results = []
          disable_pp_dashboard_permission = GoodData::Helpers.to_boolean(params.disable_pp_dashboard_permission)
          collect_synced_status = collect_synced_status(params)
          failed_projects = ThreadSafe::Array.new
Severity: Minor
Found in lib/gooddata/lcm/actions/synchronize_pp_dashboard_permission.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 call has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

        def call(params)
          results = []

          client = params.gdc_gd_client
          development_client = params.development_client
Severity: Minor
Found in lib/gooddata/lcm/actions/synchronize_ldm_layout.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 call has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

        def call(params)
          return [] unless params.dynamic_params

          schedule_title_column = params.schedule_title_column&.downcase || 'schedule_title'
          client_id_column = params.client_id_column&.downcase || 'client_id'
Severity: Minor
Found in lib/gooddata/lcm/actions/collect_dynamic_schedule_params.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 replace_from_mapping has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def replace_from_mapping(mapping, opts = {})
      default = {
        :purge => false,
        :dry_run => false
      }
Severity: Major
Found in lib/gooddata/models/project.rb - About 3 hrs to fix

    Class DataSource has 30 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class DataSource < Rest::Resource
        attr_accessor :connection_info
    
        DATA_SOURCES_URL = '/gdc/dataload/dataSources'
        SNOWFLAKE = 'snowflake'
    Severity: Minor
    Found in lib/gooddata/models/data_source.rb - About 3 hrs to fix

      Method transfer_processes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def transfer_processes(from_project, to_project, options = {})
              options = GoodData::Helpers.symbolize_keys(options)
              aliases = {}
              to_project_processes = to_project.processes
              additional_hidden_params = options[:additional_hidden_params] || {}
      Severity: Minor
      Found in lib/gooddata/models/project.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 load_data has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

              def load_data(params, data_source)
                first_name_column           = params.first_name_column&.downcase || 'first_name'
                last_name_column            = params.last_name_column&.downcase || 'last_name'
                login_column                = params.login_column&.downcase || 'login'
                password_column             = params.password_column&.downcase || 'password'
      Severity: Minor
      Found in lib/gooddata/lcm/actions/synchronize_users.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 check_params has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

              def check_params(specification, params)
                specification.keys.each do |param_name|
                  value = params.send(param_name)
                  type = specification[param_name][:type]
                  if value.nil? || (value.is_a?(String) && value.empty?)
      Severity: Minor
      Found in lib/gooddata/lcm/helpers/check_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

      Method transfer_attribute_drillpaths has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def transfer_attribute_drillpaths(source_project, targets)
              semaphore = Mutex.new
      
              # Convert to array
              targets = [targets] unless targets.is_a?(Array)
      Severity: Minor
      Found in lib/gooddata/lcm/lcm.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 resolve_reference_params has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def resolve_reference_params(data_params, params)
              reference_values = []
              regexps = Regexp.union(/\\\\/, /\\\$/, /\$\{([^\n\{\}]+)\}/)
              resolve_reference = lambda do |v|
                if v.is_a? Hash
      Severity: Minor
      Found in lib/gooddata/helpers/global_helpers_params.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 call has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                # set default value for include_computed_attributes
                # (we won't have to do this after TMA-690)
                include_ca = params.include_computed_attributes
                include_ca = true if include_ca.nil?
      Severity: Minor
      Found in lib/gooddata/lcm/actions/synchronize_cas.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

      File domain.rb has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'cgi'
      
      require_relative 'profile'
      require_relative '../extensions/enumerable'
      require_relative '../rest/object'
      Severity: Minor
      Found in lib/gooddata/models/domain.rb - About 3 hrs to fix

        Class Domain has 29 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Domain < Rest::Resource
            attr_reader :name
        
            USER_LANGUAGES = {
              'en-US' => 'English',
        Severity: Minor
        Found in lib/gooddata/models/domain.rb - About 3 hrs to fix

          Class MdObject has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class MdObject < Rest::Resource
              MD_OBJ_CTG = 'obj'
              IDENTIFIERS_CFG = 'instance-identifiers'
          
              extend Mixin::MdIdToUri
          Severity: Minor
          Found in lib/gooddata/models/metadata.rb - About 3 hrs to fix

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

                    def call(params)
                      results = []
                      collect_synced_status = collect_synced_status(params)
                      failed_projects = ThreadSafe::Array.new
            
            
            Severity: Minor
            Found in lib/gooddata/lcm/actions/synchronize_dataset_mappings.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 call has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                  def call(params)
                    params = params.to_hash
                    if params['GDC_LOGGING_OFF']
                      logger = NilLogger.new
                    elsif params['GDC_LOG_DIRECTORY'] && params['GDC_EXECUTION_ID']
            Severity: Minor
            Found in lib/gooddata/bricks/middleware/logger_middleware.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 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def perform(mode, params = {})
                    params = convert_params(params)
            
                    GoodData.gd_logger.brick = mode
            
            
            Severity: Major
            Found in lib/gooddata/lcm/lcm2.rb - About 3 hrs to fix

              Method upload_multiple_data has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def upload_multiple_data(data, project_blueprint, options = { :client => GoodData.connection, :project => GoodData.project })
                      client, project = GoodData.get_client_and_project(options)
                      project ||= GoodData.project
              
                      manifest = {
              Severity: Major
              Found in lib/gooddata/models/model.rb - About 3 hrs to fix

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

                      def self.attribute_to_wire(dataset, attribute)
                        ls = DatasetBlueprint.labels_for_attribute(dataset, attribute)
                        labels = ls.map do |l|
                          {
                            label: {
                Severity: Minor
                Found in lib/gooddata/models/blueprint/to_wire.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 call has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def call(params)
                          synchronize_projects = []
                          data_product = params.data_product
                          client = params.gdc_gd_client
                          collect_synced_status = collect_synced_status(params)
                Severity: Major
                Found in lib/gooddata/lcm/actions/provision_clients.rb - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language