nesquena/gitdocs

View on GitHub
lib/gitdocs/browser_app.rb

Summary

Maintainability
A
0 mins
Test Coverage

Class has too many lines. [117/100]
Open

  class BrowserApp < Sinatra::Base
    set :haml, format: :html5

    helpers RenderingHelper

Severity: Minor
Found in lib/gitdocs/browser_app.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Block has too many lines. [45/25]
Open

    get('/:id*') do
      default_locals = {
        root:      repository.root,
        nav_state: nil
      }
Severity: Minor
Found in lib/gitdocs/browser_app.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Unnecessary utf-8 encoding comment.
Open

# -*- encoding : utf-8 -*-
Severity: Minor
Found in lib/gitdocs/browser_app.rb by rubocop

Avoid rescuing without specifying an error class.
Open

        rescue
Severity: Minor
Found in lib/gitdocs/browser_app.rb by rubocop

This cop checks for rescuing StandardError. There are two supported styles implicit and explicit. This cop will not register an offense if any error other than StandardError is specified.

Example: EnforcedStyle: implicit

# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.

# bad
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

Example: EnforcedStyle: explicit (default)

# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.

# bad
begin
  foo
rescue
  bar
end

# good
begin
  foo
rescue StandardError
  bar
end

# good
begin
  foo
rescue OtherError
  bar
end

# good
begin
  foo
rescue StandardError, SecurityError
  bar
end

There are no issues that match your filters.

Category
Status