metaps/genova

View on GitHub

Showing 14 of 26 total issues

Method decrypt_environment_variables! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

        def decrypt_environment_variables!(task_definition)
          raise Exceptions::TaskDefinitionValidationError, '\'container_definitions\' is undefined.' unless task_definition.key?(:container_definitions)

          task_definition[:container_definitions].each do |container_definition|
            next unless container_definition.key?(:environment)
Severity: Minor
Found in lib/autoloads/genova/ecs/task/client.rb - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
Open

        def call
          logger = ::Logger.new($stdout, level: Settings.logger.level)
          images = using_images

          ::Docker::Image.all.each do |image|
Severity: Minor
Found in lib/autoloads/genova/docker/image_cleaner.rb - About 1 hr 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 deploy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def deploy(options)
        return if options[:interactive] && !HighLine.new.agree('> Do you want to deploy? (y/n): ', '')

        prepare(options)
        repository_settings = ::Genova::Config::SettingsHelper.find_repository(options[:repository])
Severity: Minor
Found in lib/tasks/deploy.rb - About 1 hr 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 allow? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def allow?(policy, value)
          permissions = Settings.slack.permissions
          return true if permissions.nil?

          rules = permissions.select { |permission| permission[:policy] == policy }
Severity: Minor
Found in lib/autoloads/genova/slack/interactive/permission.rb - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

    def perform(id)
      logger.info('Started Slack::CommandReceiveWorker')

      values = Genova::Sidekiq::JobStore.find(id)
      raise Genova::Exceptions::NotFoundError, 'Command not specified.' if values[:statement].empty?
Severity: Minor
Found in app/workers/slack/command_receive_worker.rb - About 1 hr 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 handle_io has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def handle_io(stdin, stdout, stderr)
          stdin.close_write

          loop do
            IO.select([stdout, stderr]).flatten.compact.each do |io|
Severity: Minor
Found in lib/autoloads/genova/command/executor.rb - About 1 hr 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 run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def run
        transaction = Genova::Deploy::Transaction.new(@deploy_job.repository, logger: @logger, force: @options[:force])
        transaction.begin

        @logger.info('Start deployment.')
Severity: Minor
Found in lib/autoloads/genova/deploy/runner.rb - About 1 hr to fix

    Method deploy has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def deploy(options)
            return if options[:interactive] && !HighLine.new.agree('> Do you want to deploy? (y/n): ', '')
    
            prepare(options)
            repository_settings = ::Genova::Config::SettingsHelper.find_repository(options[:repository])
    Severity: Minor
    Found in lib/tasks/deploy.rb - About 1 hr to fix

      Method parse_conditions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def parse_conditions
          conditions = {}
      
          # Dates are stored in ISODate and search is not implemented yet.
          if params[:keywords].present?
      Severity: Minor
      Found in app/controllers/deploy_jobs_controller.rb - About 55 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

      Method initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def initialize(repository, options = {})
              @account = Settings.github.account
              @branch = options[:branch]
              @tag = options[:tag]
              @logger = options[:logger] || ::Logger.new($stdout, level: Settings.logger.level)
      Severity: Minor
      Found in lib/autoloads/genova/code_manager/git.rb - About 55 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

      Method selected_repository has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

              def selected_repository
                value = @payload.dig(:actions, 0, :selected_option, :value)
                params = {}
      
                repositories = Settings.github.repositories || []
      Severity: Minor
      Found in lib/autoloads/genova/slack/request_handler.rb - About 55 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

      Method exist? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

                def exist?
                  status = nil
                  result = @ecs.describe_services(
                    cluster: @deploy_job.cluster,
                    services: [@deploy_job.service]
      Severity: Minor
      Found in lib/autoloads/genova/ecs/deployer/service/client.rb - About 45 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

      Method prepare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def prepare(options)
              options[:branch] = Settings.github.default_branch if options[:branch].nil? && options[:tag].nil?
              return if options[:repository].nil? || options[:target].nil?
      
              code_manager = ::Genova::CodeManager::Git.new(
      Severity: Minor
      Found in lib/tasks/deploy.rb - About 25 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

      Method reset_array! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

              def reset_array!(task_definition, task_overrides, *params)
                return unless task_definition.dig(*params).present?
                return unless task_overrides.dig(*params).present?
      
                if params.size > 1
      Severity: Minor
      Found in lib/autoloads/genova/ecs/task/client.rb - About 25 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

      Severity
      Category
      Status
      Source
      Language