app/controllers/setup/oauth_controller.rb
Method has too many lines. [11/10] Open
Open
def create
if current_program.oauth_client_id && current_program.oauth_client_secret
flash[:success] = "DHIS2 log-in already enabled for #{current_project.name}"
redirect_to setup_project_path(current_project)
return
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Line is too long. [109/100] Open
Open
flash[:failure] = "An error occured during set-up for DHIS2 log-in: #{e.class.name} #{e.message[0..100]}"
- Exclude checks
Use nested module/class definitions instead of compact style. Open
Open
class Setup::OauthController < PrivateController
- Read upRead up
- Exclude checks
This cop checks the style of children definitions at classes and modules. Basically there are two different styles:
Example: EnforcedStyle: nested (default)
# good
# have each child on its own line
class Foo
class Bar
end
end
Example: EnforcedStyle: compact
# good
# combine definitions as much as possible
class Foo::Bar
end
The compact style is only forced for classes/modules with one child.
Trailing whitespace detected. Open
Open
- Read upRead up
- Exclude checks
This cop looks for trailing whitespace in the source code.
Example:
# The line in this example contains spaces after the 0.
# bad
x = 0
# The line in this example ends directly after the 0.
# good
x = 0
Final newline missing. Open
Open
end
- Read upRead up
- Exclude checks
This cop looks for trailing blank lines and a final newline in the source code.
Example: EnforcedStyle: finalblankline
# `final_blank_line` looks for one blank line followed by a new line
# at the end of files.
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF
Example: EnforcedStyle: final_newline (default)
# `final_newline` looks for one newline at the end of files.
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF