darrenleeweber/aws-ops

View on GitHub

Showing 9 of 9 total issues

Class ServiceManager has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

class ServiceManager
 
attr_reader :service
attr_reader :settings
 
 
Severity: Minor
Found in lib/service/service_manager.rb - About 3 hrs to fix

    Class UbuntuHelper has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class UbuntuHelper
     
    attr_reader :current_path
    attr_reader :log_path
    attr_reader :script_path
    Severity: Minor
    Found in lib/ubuntu/ubuntu_helper.rb - About 2 hrs to fix

      Method terminate_nodes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      def terminate_nodes
      alive = nodes_alive
      if alive.empty?
      puts "There are no #{service} nodes alive"
      else
      Severity: Minor
      Found in lib/service/service_manager.rb - About 1 hr to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def stop_nodes
      alive = nodes_alive
      settings.nodes.each do |config|
      inst = alive.find { |i| AwsHelpers.ec2_instance_tag_name?(i, config.tag_name) }
      next if inst.nil?
      Severity: Minor
      Found in lib/service/service_manager.rb and 1 other location - About 30 mins to fix
      lib/service/service_manager.rb on lines 153..159

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def reboot_nodes
      alive = nodes_alive
      settings.nodes.each do |config|
      inst = alive.find { |i| AwsHelpers.ec2_instance_tag_name?(i, config.tag_name) }
      next if inst.nil?
      Severity: Minor
      Found in lib/service/service_manager.rb and 1 other location - About 30 mins to fix
      lib/service/service_manager.rb on lines 173..179

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def listeners
      manager.nodes_running.map do |inst|
      node = settings.nodes.find { |n| n.tag_name == manager.node_name(inst) }
      [node.tag_name, "PLAINTEXT://#{inst.private_dns_name}:#{node.client_port}"]
      Severity: Minor
      Found in lib/kafka/kafka_helpers.rb and 1 other location - About 30 mins to fix
      lib/kafka/kafka_helpers.rb on lines 73..76

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      manager.nodes_running.map do |inst|
      node = settings.nodes.find { |n| n.tag_name == manager.node_name(inst) }
      dns = public ? inst.public_dns_name : inst.private_dns_name
      "#{dns}:#{node.client_port}"
      Severity: Minor
      Found in lib/kafka/kafka_helpers.rb and 1 other location - About 30 mins to fix
      lib/zookeeper/zookeeper_helpers.rb on lines 27..30

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      manager.nodes_running.map do |inst|
      node = settings.nodes.find { |n| n.tag_name == manager.node_name(inst) }
      dns = public ? inst.public_dns_name : inst.private_dns_name
      "#{dns}:#{node.client_port}"
      Severity: Minor
      Found in lib/zookeeper/zookeeper_helpers.rb and 1 other location - About 30 mins to fix
      lib/kafka/kafka_helpers.rb on lines 45..48

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def advertised_listeners
      manager.nodes_running.map do |inst|
      node = settings.nodes.find { |n| n.tag_name == manager.node_name(inst) }
      [node.tag_name, "PLAINTEXT://#{inst.public_dns_name}:#{node.client_port}"]
      Severity: Minor
      Found in lib/kafka/kafka_helpers.rb and 1 other location - About 30 mins to fix
      lib/kafka/kafka_helpers.rb on lines 59..62
      Severity
      Category
      Status
      Source
      Language