gooddata/gooddata-ruby

View on GitHub

Showing 359 of 407 total issues

Method call has 162 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def call(params)
          client = params.gdc_gd_client
          domain_name = params.organization || params.domain
          fail "Either organisation or domain has to be specified in params" unless domain_name
          project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
Severity: Major
Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 6 hrs to fix

    Method perform has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

          def perform(mode, params = {})
            params = convert_params(params)
    
            GoodData.gd_logger.brick = mode
    
    
    Severity: Minor
    Found in lib/gooddata/lcm/lcm2.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

    Method transfer_schedules has 151 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def transfer_schedules(from_project, to_project, has_cycle_trigger = false)
            to_project_processes = to_project.processes.sort_by(&:name)
            from_project_processes = from_project.processes.sort_by(&:name)
            from_project_processes.reject!(&:add_v2_component?)
    
    
    Severity: Major
    Found in lib/gooddata/models/project.rb - About 6 hrs to fix

      Method replace_from_mapping has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

          def replace_from_mapping(mapping, opts = {})
            default = {
              :purge => false,
              :dry_run => false
            }
      Severity: Minor
      Found in lib/gooddata/models/project.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

      File lcm2.rb has 399 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'terminal-table'
      
      require 'gooddata/extensions/class'
      require 'gooddata/extensions/true'
      require 'gooddata/extensions/false'
      Severity: Minor
      Found in lib/gooddata/lcm/lcm2.rb - About 5 hrs to fix

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

                def call(params)
                  logger = params.gdc_logger
        
                  client = params.gdc_gd_client
                  project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
        Severity: Minor
        Found in lib/gooddata/lcm/actions/execute_schedules.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

        Class Client has 38 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Client
              #################################
              # Constants
              #################################
              DEFAULT_CONNECTION_IMPLEMENTATION = GoodData::Rest::Connection
        Severity: Minor
        Found in lib/gooddata/rest/client.rb - About 5 hrs to fix

          Class Connection has 38 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class Connection
                include MonitorMixin
          
                HTTPS_PROTOCOL = 'https://'
                HTTP_PROTOCOL = 'http://'
          Severity: Minor
          Found in lib/gooddata/rest/connection.rb - About 5 hrs to fix

            Class Process has 36 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class Process < Rest::Resource
                attr_reader :data
            
                alias_method :raw_data, :data
                alias_method :json, :data
            Severity: Minor
            Found in lib/gooddata/models/process.rb - About 4 hrs to fix

              File schedule.rb has 351 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_relative '../rest/resource'
              require_relative '../mixins/rest_resource'
              require_relative '../helpers/global_helpers'
              
              require_relative 'execution'
              Severity: Minor
              Found in lib/gooddata/models/schedule.rb - About 4 hrs to fix

                File synchronize_users.rb has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require_relative 'base_action'
                require_relative '../user_bricks_helper'
                
                module GoodData
                  module LCM2
                Severity: Minor
                Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 4 hrs to fix

                  Method add_user has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def add_user(user_data, name = nil, opts = { :client => GoodData.connection })
                          generated_pass = GoodData::Helpers::CryptoHelper.generate_password
                          domain_name = name || user_data[:domain]
                          user_data = user_data.to_hash
                          data = {
                  Severity: Minor
                  Found in lib/gooddata/models/domain.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

                  Method call has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def call(params)
                            client = params.gdc_gd_client
                            domain_name = params.organization || params.domain
                            fail "Either organisation or domain has to be specified in params" unless domain_name
                  
                  
                  Severity: Major
                  Found in lib/gooddata/lcm/actions/synchronize_user_filters.rb - About 4 hrs to fix

                    Method call has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def call(params)
                              client = params.gdc_gd_client
                              data_product = params.data_product
                              collect_synced_status = collect_synced_status(params)
                              failed_projects = ThreadSafe::Array.new
                    Severity: Major
                    Found in lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb - About 4 hrs to fix

                      Method import_users has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def import_users(new_users, options = {})
                            role_list = roles
                            users_list = users
                      
                            GoodData.logger.warn("Importing users to project (#{pid})")
                      Severity: Major
                      Found in lib/gooddata/models/project.rb - About 4 hrs to fix

                        Method update_user has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def update_user(user_data, options = { client: GoodData.connection })
                                user_data = user_data.to_hash if user_data.is_a?(GoodData::Profile)
                                client = client(options)
                                user_data = user_data.to_hash
                                data = {
                        Severity: Minor
                        Found in lib/gooddata/models/domain.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 27 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def call(params)
                                  client = params.gdc_gd_client
                        
                                  domain_name = params.organization || params.domain
                                  fail "Either organisation or domain has to be specified in params" unless domain_name
                        Severity: Minor
                        Found in lib/gooddata/lcm/actions/synchronize_clients.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 sync_segment_ldm has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def sync_segment_ldm(params, segment_info)
                                  collect_synced_status = collect_synced_status(params)
                                  failed_projects = ThreadSafe::Array.new
                                  results = ThreadSafe::Array.new
                                  client = params.gdc_gd_client
                        Severity: Major
                        Found in lib/gooddata/lcm/actions/synchronize_ldm.rb - About 3 hrs to fix

                          Class ReportDataResult has 31 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class ReportDataResult < Rest::Resource
                              class << self
                                # Does all the needed parsing on the apyload coming from the API and returns an instance of ReportDataResult
                                #
                                # @param [Hash] data Data coming from the API
                          Severity: Minor
                          Found in lib/gooddata/models/report_data_result.rb - About 3 hrs to fix

                            Method execute_mufs has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def self.execute_mufs(user_filters, options = {})
                                  client = options[:client]
                                  project = options[:project]
                                  ignore_missing_values = options[:ignore_missing_values]
                                  users_must_exist = options[:users_must_exist] == false ? false : true
                            Severity: Major
                            Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language