natydev/fitbark

View on GitHub

Showing 145 of 145 total issues

Trailing whitespace detected.
Open

    # - *activity_average*, 
Severity: Minor
Found in lib/fitbark/data/activity_daily.rb by rubocop

Trailing whitespace detected.
Open

    # - *slug*  
Severity: Minor
Found in lib/fitbark/data/user_preview.rb by rubocop

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

    "documentation_uri" => "https://www.rubydoc.info/github/natydev/fitbark/master"
Severity: Minor
Found in fitbark.gemspec by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

          unless conn.success?
Severity: Minor
Found in lib/fitbark/handler/v2/base.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

Trailing whitespace detected.
Open

    # - *last_name*   
Severity: Minor
Found in lib/fitbark/data/user_preview.rb by rubocop

unexpected token tCOLON (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

            "date": set_on.to_s

unexpected token tCOLON (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

              "to": to

Trailing whitespace detected.
Open

    # Original attribute names from source API:  
Severity: Minor
Found in lib/fitbark/data/breed.rb by rubocop

Space missing inside }.
Open

          select{|h| h['status'].upcase == 'OWNER'}.map do |rel|
Severity: Minor
Found in lib/fitbark/handler/v2/own_dogs.rb by rubocop

Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

Example: EnforcedStyle: space (default)

# The `space` style enforces that block braces have
# surrounding space.

# bad
some_array.each {puts e}

# good
some_array.each { puts e }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that block braces don't
# have surrounding space.

# bad
some_array.each { puts e }

# good
some_array.each {puts e}

Example: EnforcedStyleForEmptyBraces: no_space (default)

# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# block braces don't have a space in between when empty.

# bad
some_array.each {   }
some_array.each {  }
some_array.each { }

# good
some_array.each {}

Example: EnforcedStyleForEmptyBraces: space

# The `space` EnforcedStyleForEmptyBraces style enforces that
# block braces have at least a spece in between when empty.

# bad
some_array.each {}

# good
some_array.each { }
some_array.each {  }
some_array.each {   }

Example: SpaceBeforeBlockParameters: true (default)

# The SpaceBeforeBlockParameters style set to `true` enforces that
# there is a space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each {|n| n * 2 }

# good
[1, 2, 3].each { |n| n * 2 }

Example: SpaceBeforeBlockParameters: true

# The SpaceBeforeBlockParameters style set to `false` enforces that
# there is no space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each { |n| n * 2 }

# good
[1, 2, 3].each {|n| n * 2 }

unexpected token tCOLON (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

            "dog": {

Useless assignment to variable - e.
Open

    rescue NameError => e
Severity: Minor
Found in lib/fitbark/client.rb by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

When using method_missing, define respond_to_missing?.
Open

    def method_missing(method, **args)
      if respond_to?(method)
        klass_handler(method).new(token: token, opts: args).response
      else
        super
Severity: Minor
Found in lib/fitbark/client.rb by rubocop

This cop checks for the presence of method_missing without also defining respond_to_missing? and falling back on super.

Example:

#bad
def method_missing(name, *args)
  # ...
end

#good
def respond_to_missing?(name, include_private)
  # ...
end

def method_missing(name, *args)
  # ...
  super
end

Trailing whitespace detected.
Open

    # Original attribute names from source API:  
Severity: Minor
Found in lib/fitbark/data/user_info.rb by rubocop

Line is too long. [82/80]
Open

    #   auth = Fitbark::Auth.new(client_id: client_id, redirect_uri: redirect_uri,
Severity: Minor
Found in lib/fitbark/auth.rb by rubocop

Trailing whitespace detected.
Open

    # Original attribute names from source API:  
Severity: Minor
Found in lib/fitbark/data/activity_level.rb by rubocop

Trailing whitespace detected.
Open

    # - *username*  
Severity: Minor
Found in lib/fitbark/data/user_preview.rb by rubocop

Trailing whitespace detected.
Open

    # Original attribute names from source API: 
Severity: Minor
Found in lib/fitbark/data/user_relation.rb by rubocop

Trailing whitespace detected.
Open

    # Original attribute names from source API: 
Severity: Minor
Found in lib/fitbark/data/dog_relation.rb by rubocop

The use of eval is a serious security risk.
Open

      eval("#{PREFIX_NAME_HANDLER}#{camel(handler.to_s)}")
Severity: Minor
Found in lib/fitbark/client.rb by rubocop

This cop checks for the use of Kernel#eval and Binding#eval.

Example:

# bad

eval(something)
binding.eval(something)

Trailing whitespace detected.
Open

    # 
Severity: Minor
Found in lib/fitbark/auth.rb by rubocop
Severity
Category
Status
Source
Language