hello-gem/hello

View on GitHub

Showing 310 of 310 total issues

Method parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def parse(user_agent_string)
obj = user_agent_parser.parse(user_agent_string)
a_browser = obj.to_s
a_os = obj.os.to_s
a_browser = "#{obj.name} #{obj.version && obj.version.major}".strip
Severity: Minor
Found in lib/hello/utils/device_name.rb - About 25 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def to_onboarding
respond_to do |format|
format.html { redirect_to '/onboarding' }
format.json do
data = { 'message' => 'Access Denied, visit /onboarding and complete your registration.' }
Severity: Minor
Found in lib/hello/rails_controller/restrict_by_role.rb and 1 other location - About 20 mins to fix
lib/hello/rails_controller/restrict_by_role.rb on lines 33..40

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def to_root
respond_to do |format|
format.html { redirect_to '/' }
format.json do
data = { 'message' => 'Access Denied.' }
Severity: Minor
Found in lib/hello/rails_controller/restrict_by_role.rb and 1 other location - About 20 mins to fix
lib/hello/rails_controller/restrict_by_role.rb on lines 58..65

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def create
business = Business::Management::AddEmail.new(@credential)
if @credential.save
redirect_to hello.emails_path, notice: business.success_message
else
Severity: Minor
Found in app/controllers/hello/management/emails_controller.rb and 1 other location - About 15 mins to fix
app/controllers/hello/management/emails_controller.rb on lines 32..38

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def destroy
business = Business::Management::RemoveEmail.new(@credential)
if @credential.destroy
redirect_to hello.emails_path, notice: business.success_message
else
Severity: Minor
Found in app/controllers/hello/management/emails_controller.rb and 1 other location - About 15 mins to fix
app/controllers/hello/management/emails_controller.rb on lines 21..27

Extra blank line detected.
Open

 
dont_kick :user, only: [:cancel, :destroy]

Missing magic comment # frozen_string_literal: true.
Open

module Hello

Missing magic comment # frozen_string_literal: true.
Open

module Hello

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

@sign_up.errors[:base] << "Email Registration is temporarily disabled"

Missing magic comment # frozen_string_literal: true.
Open

class CreateUsers < ActiveRecord::Migration
Severity: Minor
Found in db/migrate/3_create_users.rb by rubocop

Missing magic comment # frozen_string_literal: true.
Open

module User::Authorization

Missing magic comment # frozen_string_literal: true.
Open

module Hello
Severity: Minor
Found in lib/hello/errors.rb by rubocop

Extra empty line detected at module body end.
Open

 
end

Use %i or %I for an array of symbols.
Open

before_action(only: [:show, :update]) do

Missing magic comment # frozen_string_literal: true.
Open

module Hello

Always use raise to signal exceptions.
Open

format.json { fail Hello::Errors::JsonNotSupported }

Missing magic comment # frozen_string_literal: true.
Open

module Hello

Missing magic comment # frozen_string_literal: true.
Open

require 'hello'

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

puts "Usage:".light_yellow

Extra empty line detected at block body end.
Open

 
end
Severity
Category
Status
Source
Language