vital-edu/sala-de-espera

View on GitHub
app/controllers/services_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Line is too long. [88/80]
Open

      format.html { redirect_to services_url, notice: 'Serviço destruído com sucesso.' }

Missing top-level class documentation comment.
Open

class ServicesController < ApplicationController

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Line is too long. [83/80]
Open

        format.html { redirect_to @service, notice: 'Serviço criado com sucesso.' }

Missing method documentation comment.
Open

  def new
    @service = Service.new
  end

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Missing method documentation comment.
Open

  def create
    @service = Service.new(service_params)
    @service.status = 1
    @service.employee = current_user

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Missing method documentation comment.
Open

  def show
  end

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Put empty method definitions on a single line.
Open

  def edit
  end

This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

Note: A method definition is not considered empty if it contains comments.

Example: EnforcedStyle: compact (default)

# bad
def foo(bar)
end

def self.foo(bar)
end

# good
def foo(bar); end

def foo(bar)
  # baz
end

def self.foo(bar); end

Example: EnforcedStyle: expanded

# bad
def foo(bar); end

def self.foo(bar); end

# good
def foo(bar)
end

def self.foo(bar)
end

Line is too long. [87/80]
Open

        format.html { redirect_to @service, notice: 'Serviço atualizado com sucesso.' }

Line is too long. [100/80]
Open

    params.require(:service).permit(:scheduled_time, :employee_id, :client_id, :service_category_id)

Missing method documentation comment.
Open

  def destroy
    @service.destroy!
    respond_to do |format|
      format.html { redirect_to services_url, notice: 'Serviço destruído com sucesso.' }
    end

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Put empty method definitions on a single line.
Open

  def show
  end

This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

Note: A method definition is not considered empty if it contains comments.

Example: EnforcedStyle: compact (default)

# bad
def foo(bar)
end

def self.foo(bar)
end

# good
def foo(bar); end

def foo(bar)
  # baz
end

def self.foo(bar); end

Example: EnforcedStyle: expanded

# bad
def foo(bar); end

def self.foo(bar); end

# good
def foo(bar)
end

def self.foo(bar)
end

Missing method documentation comment.
Open

  def update
    respond_to do |format|
      if @service.update(service_params)
        format.html { redirect_to @service, notice: 'Serviço atualizado com sucesso.' }
      else

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Missing method documentation comment.
Open

  def index
    @services = Service.where(employee_id: current_user.id)
  end

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

Missing method documentation comment.
Open

  def edit
  end

This cop checks for missing documentation comment for public methods. It can optionally be configured to also require documentation for non-public methods.

Example:

# bad

class Foo
  def bar
    puts baz
  end
end

module Foo
  def bar
    puts baz
  end
end

def foo.bar
  puts baz
end

# good

class Foo
  # Documentation
  def bar
    puts baz
  end
end

module Foo
  # Documentation
  def bar
    puts baz
  end
end

# Documentation
def foo.bar
  puts baz
end

There are no issues that match your filters.

Category
Status