vital-edu/sala-de-espera

View on GitHub
app/controllers/service_categories_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Line is too long. [109/80]
Open

        format.html { redirect_to @service_category, notice: 'Categoria de serviço atualizada com sucesso.' }

Line is too long. [105/80]
Open

        format.html { redirect_to @service_category, notice: 'Categoria de serviço criada com sucesso.' }

Line is too long. [81/80]
Open

    params.require(:service_category).permit(:name, :description, :price, :image)

Line is too long. [111/80]
Open

      format.html { redirect_to service_categories_url, notice: 'Categoria de serviço destruída com sucesso.' }

Missing method documentation comment.
Open

  def update
    respond_to do |format|
      if @service_category.update(service_category_params)
        format.html { redirect_to @service_category, notice: 'Categoria de serviço atualizada 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 create
    @service_category = ServiceCategory.new(service_category_params)

    respond_to do |format|
      if @service_category.save

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 destroy
    @service_category.destroy!
    respond_to do |format|
      format.html { redirect_to service_categories_url, notice: 'Categoria de serviço destruída 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

Missing method documentation comment.
Open

  def index
    @service_categories = ServiceCategory.all
  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

Missing top-level class documentation comment.
Open

class ServiceCategoriesController < 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

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

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

Missing method documentation comment.
Open

  def new
    @service_category = ServiceCategory.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

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

There are no issues that match your filters.

Category
Status