Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extract regex into constant

  • Loading branch information...
commit 801396225270bbdd84b6a0562a9d47522a3f26df 1 parent 6086010
Corey Haines coreyhaines authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/turbulence/calculators/complexity.rb
3  lib/turbulence/calculators/complexity.rb
View
@@ -24,8 +24,9 @@ def score_for_file(filename)
end
class Reporter < ::StringIO
+ SCORE_LINE_DETECTOR = /^\s+([^:]+).*flog total$/
def score
- Float(string.scan(/^\s+([^:]+).*total$/).flatten.first)
+ Float(string.scan(SCORE_LINE_DETECTOR).flatten.first)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.