AndyObtiva/abstract_feature_branch

View on GitHub

Showing 6 of 6 total issues

File abstract_feature_branch.rb has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rubygems'
require 'bundler'
require 'yaml'
YAML::ENGINE.yamler = "syck" if RUBY_VERSION.start_with?('1.9')
begin
Severity: Minor
Found in lib/abstract_feature_branch.rb - About 2 hrs to fix

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

        def load_redis_scoped_features
          @redis_scoped_features = {}
          return @redis_scoped_features if AbstractFeatureBranch.configuration.feature_store_live_fetching?
          
          @environment_features.each do |environment, features|
    Severity: Minor
    Found in lib/abstract_feature_branch.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 beautify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.beautify(content)
        #Not relying on ordered hashes for backwards compatibility with Ruby 1.8.7
        sections = []
        section_features = []
        content.split("\n").each do |line|
    Severity: Minor
    Found in lib/abstract_feature_branch/file_beautifier.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 memoize_thread_safe has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def memoize_thread_safe(variable, variable_build_method_name = nil, &variable_builder)
          variable_builder ||= method(variable_build_method_name)
          if instance_variable_get(variable).nil?
            mutex_hash = self.is_a?(Module) ? self::MUTEX : self.class::MUTEX
            mutex_hash[variable].synchronize do
    Severity: Minor
    Found in lib/abstract_feature_branch/memoizable.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 feature_store= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def feature_store=(feature_store)
          if feature_store.nil?
            @feature_store = nil
          else
            begin
    Severity: Minor
    Found in lib/abstract_feature_branch/configuration.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

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

        def get_store_feature(feature)
          raise 'Feature storage (e.g. Redis) is not setup!' if feature_store.nil?
          feature = feature.to_s
          value = feature_store.hget(REDIS_HKEY, feature)
          if value.nil?
    Severity: Minor
    Found in lib/abstract_feature_branch.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