Skip to content

Instantly share code, notes, and snippets.

@SophieDeBenedetto
Created January 28, 2016 18:14
Show Gist options
  • Save SophieDeBenedetto/1018f6c42520e5281da1 to your computer and use it in GitHub Desktop.
Save SophieDeBenedetto/1018f6c42520e5281da1 to your computer and use it in GitHub Desktop.
analysis = Rubycritic::CommandFactory.create(paths: ['.']).critique
modules = analysis.map {|mod| mod}
projects = modules.map do |mod|
{name: mod.name, path: mod.path, rating: mod.rating, smells: mod.smells,
complexity: mod.complexity, church: mod.churn, duplication: mod.duplication,
thod_count: mod.method_count}
end
mod.rating
# => #<Rubycritic::Rating:0x007f8b1e9e6f00 @letter="A">
smell.locations
# => [#<Rubycritic::Location:0x007f8b1abe5df0
# @line=1,
# @pathname=
# #<Pathname:app/controllers/api/v1/readmes_controller.rb>>]
smell.context
# => "Api::V1::ReadmesController"
smell.message
# => "has no descriptive comment"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment