AndyObtiva/abstract_feature_branch

View on GitHub
lib/abstract_feature_branch.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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 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

    There are no issues that match your filters.

    Category
    Status