Skip to content

Commit

Permalink
Add reek
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Grachev <work@mgrachev.com>
  • Loading branch information
mgrachev committed Nov 12, 2019
1 parent a885a24 commit ca60633
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fmts/ruby.go
Expand Up @@ -16,4 +16,15 @@ func init() {
Language: lang,
})

register(&Fmt{
Name: "reek",
Errorformat: []string{
`%*\s%f:%l: %m`,
`%-G%.%#`,
},
Description: "Code smell detector for Ruby",
URL: "https://github.com/troessner/reek",
Language: lang,
})

}
110 changes: 110 additions & 0 deletions fmts/testdata/reek.in
@@ -0,0 +1,110 @@
Inspecting 101 file(s):
...SS.SSSSSS.S....SSSS..S.......S...................................S.....SSSSSSSSSSSSSSSSSSSSSSSSS..

app/controllers/api_controller.rb -- 1 warning:
app/controllers/api_controller.rb:3: IrresponsibleModule: ApiController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/application_controller.rb -- 1 warning:
app/controllers/application_controller.rb:3: IrresponsibleModule: ApplicationController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/concerns/respondable.rb -- 4 warnings:
app/controllers/concerns/respondable.rb:8: FeatureEnvy: Respondable#render_result refers to 'result' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
app/controllers/concerns/respondable.rb:46: UtilityFunction: Respondable#error_serializer_for doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
app/controllers/concerns/respondable.rb:33: UtilityFunction: Respondable#serialize doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
app/controllers/concerns/respondable.rb:42: UtilityFunction: Respondable#to_json doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
app/controllers/countries_controller.rb -- 1 warning:
app/controllers/countries_controller.rb:3: IrresponsibleModule: CountriesController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/open_api_controller.rb -- 1 warning:
app/controllers/open_api_controller.rb:3: IrresponsibleModule: OpenApiController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/password_controller.rb -- 1 warning:
app/controllers/password_controller.rb:3: IrresponsibleModule: PasswordController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/session_controller.rb -- 1 warning:
app/controllers/session_controller.rb:3: IrresponsibleModule: SessionController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/controllers/users_controller.rb -- 1 warning:
app/controllers/users_controller.rb:3: IrresponsibleModule: UsersController has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/errors/invalid_credentials_error.rb -- 1 warning:
app/errors/invalid_credentials_error.rb:3: IrresponsibleModule: InvalidCredentialsError has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/jobs/geocode_user_ip_job.rb -- 2 warnings:
app/jobs/geocode_user_ip_job.rb:3: IrresponsibleModule: GeocodeUserIpJob has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/jobs/geocode_user_ip_job.rb:6: UtilityFunction: GeocodeUserIpJob#perform doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
app/mailers/application_mailer.rb -- 1 warning:
app/mailers/application_mailer.rb:3: IrresponsibleModule: ApplicationMailer has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/mailers/notifications_mailer.rb -- 3 warnings:
app/mailers/notifications_mailer.rb:11: DuplicateMethodCall: NotificationsMailer#password_reset calls 'user.email' 2 times [https://github.com/troessner/reek/blob/v5.4.0/docs/Duplicate-Method-Call.md]
app/mailers/notifications_mailer.rb:5: DuplicateMethodCall: NotificationsMailer#signup calls 'user.email' 2 times [https://github.com/troessner/reek/blob/v5.4.0/docs/Duplicate-Method-Call.md]
app/mailers/notifications_mailer.rb:3: IrresponsibleModule: NotificationsMailer has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/models/admin_user.rb -- 1 warning:
app/models/admin_user.rb:3: IrresponsibleModule: AdminUser has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
app/models/country.rb -- 1 warning:
app/models/country.rb:3: IrresponsibleModule: Country has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
config/application.rb -- 1 warning:
config/application.rb:41: IrresponsibleModule: EasygorussiaApi::Application has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
spec/support/api_test_helpers.rb -- 1 warning:
spec/support/api_test_helpers.rb:3: IrresponsibleModule: ApiTestHelpers has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/operations/country.rb -- 1 warning:
lib/docs/public/operations/country.rb:6: IrresponsibleModule: Docs::Public::Operations::Country has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/operations/session.rb -- 1 warning:
lib/docs/public/operations/session.rb:6: IrresponsibleModule: Docs::Public::Operations::Session has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/operations/user.rb -- 1 warning:
lib/docs/public/operations/user.rb:6: IrresponsibleModule: Docs::Public::Operations::User has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/root.rb -- 1 warning:
lib/docs/public/root.rb:5: IrresponsibleModule: Docs::Public::Root has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/schemas/api_key.rb -- 1 warning:
lib/docs/public/schemas/api_key.rb:6: IrresponsibleModule: Docs::Public::Schemas::ApiKey has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/schemas/country.rb -- 1 warning:
lib/docs/public/schemas/country.rb:6: IrresponsibleModule: Docs::Public::Schemas::Country has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/schemas/errors.rb -- 1 warning:
lib/docs/public/schemas/errors.rb:6: IrresponsibleModule: Docs::Public::Schemas::Errors has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/schemas/session.rb -- 1 warning:
lib/docs/public/schemas/session.rb:6: IrresponsibleModule: Docs::Public::Schemas::Session has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/docs/public/schemas/user.rb -- 1 warning:
lib/docs/public/schemas/user.rb:6: IrresponsibleModule: Docs::Public::Schemas::User has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/auth/authenticate.rb -- 2 warnings:
lib/operations/auth/authenticate.rb:7: IrresponsibleModule: Operations::Auth::Authenticate has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/auth/authenticate.rb:17: UtilityFunction: Operations::Auth::Authenticate#find_user doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
lib/operations/auth/sign_in.rb -- 1 warning:
lib/operations/auth/sign_in.rb:7: IrresponsibleModule: Operations::Auth::SignIn has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/password/request_reset_token.rb -- 3 warnings:
lib/operations/password/request_reset_token.rb:7: IrresponsibleModule: Operations::Password::RequestResetToken has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/password/request_reset_token.rb:19: UtilityFunction: Operations::Password::RequestResetToken#find_user doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
lib/operations/password/request_reset_token.rb:23: UtilityFunction: Operations::Password::RequestResetToken#generate_and_deliver_token doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Utility-Function.md]
lib/operations/password/reset.rb -- 2 warnings:
lib/operations/password/reset.rb:13: DuplicateMethodCall: Operations::Password::Reset#call calls 'user.api_keys' 2 times [https://github.com/troessner/reek/blob/v5.4.0/docs/Duplicate-Method-Call.md]
lib/operations/password/reset.rb:7: IrresponsibleModule: Operations::Password::Reset has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/users/confirm.rb -- 1 warning:
lib/operations/users/confirm.rb:7: IrresponsibleModule: Operations::Users::Confirm has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
lib/operations/users/sign_up.rb -- 2 warnings:
lib/operations/users/sign_up.rb:11: FeatureEnvy: Operations::Users::SignUp#call refers to 'input' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
lib/operations/users/sign_up.rb:7: IrresponsibleModule: Operations::Users::SignUp has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191022095734_enable_extension_for_uuid.rb -- 1 warning:
db/migrate/20191022095734_enable_extension_for_uuid.rb:3: IrresponsibleModule: EnableExtensionForUuid has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191022104039_create_users.rb -- 4 warnings:
db/migrate/20191022104039_create_users.rb:6: FeatureEnvy: CreateUsers#change refers to 't' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
db/migrate/20191022104039_create_users.rb:3: IrresponsibleModule: CreateUsers has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191022104039_create_users.rb:4: TooManyStatements: CreateUsers#change has approx 12 statements [https://github.com/troessner/reek/blob/v5.4.0/docs/Too-Many-Statements.md]
db/migrate/20191022104039_create_users.rb:5: UncommunicativeVariableName: CreateUsers#change has the variable name 't' [https://github.com/troessner/reek/blob/v5.4.0/docs/Uncommunicative-Variable-Name.md]
db/migrate/20191022105647_create_api_keys.rb -- 4 warnings:
db/migrate/20191022105647_create_api_keys.rb:6: FeatureEnvy: CreateApiKeys#change refers to 't' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
db/migrate/20191022105647_create_api_keys.rb:3: IrresponsibleModule: CreateApiKeys has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191022105647_create_api_keys.rb:4: TooManyStatements: CreateApiKeys#change has approx 6 statements [https://github.com/troessner/reek/blob/v5.4.0/docs/Too-Many-Statements.md]
db/migrate/20191022105647_create_api_keys.rb:5: UncommunicativeVariableName: CreateApiKeys#change has the variable name 't' [https://github.com/troessner/reek/blob/v5.4.0/docs/Uncommunicative-Variable-Name.md]
db/migrate/20191028114856_devise_create_admin_users.rb -- 4 warnings:
db/migrate/20191028114856_devise_create_admin_users.rb:7: FeatureEnvy: DeviseCreateAdminUsers#change refers to 't' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
db/migrate/20191028114856_devise_create_admin_users.rb:3: IrresponsibleModule: DeviseCreateAdminUsers has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191028114856_devise_create_admin_users.rb:4: TooManyStatements: DeviseCreateAdminUsers#change has approx 14 statements [https://github.com/troessner/reek/blob/v5.4.0/docs/Too-Many-Statements.md]
db/migrate/20191028114856_devise_create_admin_users.rb:5: UncommunicativeVariableName: DeviseCreateAdminUsers#change has the variable name 't' [https://github.com/troessner/reek/blob/v5.4.0/docs/Uncommunicative-Variable-Name.md]
db/migrate/20191028114859_create_active_admin_comments.rb -- 3 warnings:
db/migrate/20191028114859_create_active_admin_comments.rb:3: IrresponsibleModule: CreateActiveAdminComments has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191028114859_create_active_admin_comments.rb:4: TooManyStatements: CreateActiveAdminComments#self.up has approx 7 statements [https://github.com/troessner/reek/blob/v5.4.0/docs/Too-Many-Statements.md]
db/migrate/20191028114859_create_active_admin_comments.rb:5: UncommunicativeVariableName: CreateActiveAdminComments#self.up has the variable name 't' [https://github.com/troessner/reek/blob/v5.4.0/docs/Uncommunicative-Variable-Name.md]
db/migrate/20191105114613_create_countries.rb -- 3 warnings:
db/migrate/20191105114613_create_countries.rb:6: FeatureEnvy: CreateCountries#change refers to 't' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v5.4.0/docs/Feature-Envy.md]
db/migrate/20191105114613_create_countries.rb:3: IrresponsibleModule: CreateCountries has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191105114613_create_countries.rb:5: UncommunicativeVariableName: CreateCountries#change has the variable name 't' [https://github.com/troessner/reek/blob/v5.4.0/docs/Uncommunicative-Variable-Name.md]
db/migrate/20191108095330_add_country_to_user.rb -- 1 warning:
db/migrate/20191108095330_add_country_to_user.rb:3: IrresponsibleModule: AddCountryToUser has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191108100743_update_users.rb -- 1 warning:
db/migrate/20191108100743_update_users.rb:3: IrresponsibleModule: UpdateUsers has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191108101216_update_api_keys.rb -- 1 warning:
db/migrate/20191108101216_update_api_keys.rb:3: IrresponsibleModule: UpdateApiKeys has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
db/migrate/20191110224523_rename_country_on_users.rb -- 1 warning:
db/migrate/20191110224523_rename_country_on_users.rb:3: IrresponsibleModule: RenameCountryOnUsers has no descriptive comment [https://github.com/troessner/reek/blob/v5.4.0/docs/Irresponsible-Module.md]
65 total warnings

0 comments on commit ca60633

Please sign in to comment.