From 22304a0c4e472f2a57d5ccf3d1a214d273d98be1 Mon Sep 17 00:00:00 2001 From: Renato Arruda Date: Fri, 15 Nov 2019 23:08:31 +0100 Subject: [PATCH] wip - lint --- .rubocop.yml | 9 +++++---- lib/unleash/feature_toggle.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1698416b..8f19a537 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,12 +12,13 @@ Metrics/MethodLength: Max: 26 Metrics/BlockLength: Max: 360 + Metrics/AbcSize: Max: 25 -# Metrics/CyclomaticComplexity: -# Max: 19 -# Metrics/PerceivedComplexity: -# Max: 19 +Metrics/CyclomaticComplexity: + Max: 8 +Metrics/PerceivedComplexity: + Max: 8 Style/Documentation: Enabled: false diff --git a/lib/unleash/feature_toggle.rb b/lib/unleash/feature_toggle.rb index 3532715a..fcfc12ec 100644 --- a/lib/unleash/feature_toggle.rb +++ b/lib/unleash/feature_toggle.rb @@ -77,7 +77,7 @@ def am_enabled?(context, default_result) result = if self.enabled self.strategies.empty? || - self.strategies.select{ |s| strategy_enabled?(s, context) }.any? + self.strategies.any?{ |s| strategy_enabled?(s, context) } else default_result end