smudge/sojourn

View on GitHub
lib/sojourn/tracker.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for fetch_default_properties is too high. [25.32/15]
Open

    def fetch_default_properties(properties = {})
      if Sojourn.config.default_properties_block
        @ctx.define_singleton_method :sojourn_event_properties,
                                     Sojourn.config.default_properties_block
      end
Severity: Minor
Found in lib/sojourn/tracker.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Use properties[:referer] = request.referer_data instead of properties.merge! referer: request.referer_data.
Open

      properties.merge! referer: request.referer_data if request.referer_data.any?
Severity: Minor
Found in lib/sojourn/tracker.rb by rubocop

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

Use properties[:request] = request.raw_data instead of properties.merge! request: request.raw_data.
Open

      properties.merge! request: request.raw_data
Severity: Minor
Found in lib/sojourn/tracker.rb by rubocop

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

Use properties[:browser] = request.browser_data instead of properties.merge! browser: request.browser_data.
Open

      properties.merge! browser: request.browser_data
Severity: Minor
Found in lib/sojourn/tracker.rb by rubocop

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

Use properties[:campaign] = request.tracked_params instead of properties.merge! campaign: request.tracked_params.
Open

      properties.merge! campaign: request.tracked_params if request.tracked_params.any?
Severity: Minor
Found in lib/sojourn/tracker.rb by rubocop

This cop identifies places where Hash#merge! can be replaced by Hash#[]=.

Example:

hash.merge!(a: 1)
hash.merge!({'key' => 'value'})
hash.merge!(a: 1, b: 2)

There are no issues that match your filters.

Category
Status