gooddata/gooddata-ruby

View on GitHub
lib/gooddata/lcm/actions/synchronize_users.rb

Summary

Maintainability
F
3 days
Test Coverage

Method call has a Cognitive Complexity of 80 (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
          project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
Severity: Minor
Found in lib/gooddata/lcm/actions/synchronize_users.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

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

    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 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 load_data has 61 lines of code (exceeds 25 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: Major
      Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 2 hrs to fix

        Method read_csv_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                def read_csv_file(path)
                  GoodData.logger.info('Start reading csv file')
                  res = []
                  row_count = 0
        
        
        Severity: Minor
        Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 35 mins 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

        There are no issues that match your filters.

        Category
        Status