Method wait
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def wait(timeout: nil, events: %i[create update delete])
retry_connection = true
begin
watcher = kubeclient.watch_pods(:namespace => namespace)
- Read upRead up
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 Kubernetes
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Kubernetes < Floe::Runner
include Floe::ContainerRunner::DockerMixin
TOKEN_FILE = "/run/secrets/kubernetes.io/serviceaccount/token"
CA_CERT_FILE = "/run/secrets/kubernetes.io/serviceaccount/ca.crt"
File kubernetes.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Floe
class ContainerRunner
class Kubernetes < Floe::Runner
include Floe::ContainerRunner::DockerMixin
Method pod_spec
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pod_spec(name, image, env, secret = nil)
spec = {
:kind => "Pod",
:apiVersion => "v1",
:metadata => {
Method initialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
require "active_support/core_ext/hash/keys"
require "awesome_spawn"
require "securerandom"
require "base64"
- Read upRead up
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 wait
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def wait(timeout: nil, events: %i[create update delete])
retry_connection = true
begin
watcher = kubeclient.watch_pods(:namespace => namespace)
Method kubeclient
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def kubeclient
return @kubeclient unless @kubeclient.nil?
if server && token
api_endpoint = server
- Read upRead up
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"