Flockingbird/roost

View on GitHub
app/web/view_models/profile.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
84%

ViewModels::Profile::NullProfile#updated_at doesn't depend on instance state (maybe move it to another class?)
Wontfix

      def updated_at
Severity: Minor
Found in app/web/view_models/profile.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

ViewModels::Profile#self.build performs a nil-check
Wontfix

        NullProfile.new if obj.nil?
Severity: Minor
Found in app/web/view_models/profile.rb by reek

A NilCheck is a type check. Failures of NilCheck violate the "tell, don't ask" principle.

Additionally, type checks often mask bigger problems in your source code like not using OOP and / or polymorphism when you should.

Example

Given

class Klass
  def nil_checker(argument)
    if argument.nil?
      puts "argument isn't nil!"
    end
  end
end

Reek would emit the following warning:

test.rb -- 1 warning:
  [3]:Klass#nil_checker performs a nil-check. (NilCheck)

There are no issues that match your filters.

Category
Status