ringcentral-ruby/lita-glip

View on GitHub
lib/lita/adapters/glip/user_creator.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for create_user is too high. [23.22/15]
Open

          def create_user(user_id, glip_sdk)
            res = glip_sdk.persons.get personId: user_id
            Lita.logger.debug("Glip API Response Status: #{res.status}.")

            if res.status == 200

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

Method has too many lines. [15/10]
Open

          def create_user(user_id, glip_sdk)
            res = glip_sdk.persons.get personId: user_id
            Lita.logger.debug("Glip API Response Status: #{res.status}.")

            if res.status == 200

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

Line is too long. [87/80]
Open

            "#{glip_user['firstName']} #{glip_user['lastName']}".gsub(/\s+/, ' ').strip

Trailing whitespace detected.
Open

              Lita.logger.debug("Created New User With User Name [#{glip_user['id']}][#{glip_user_name}]")           

Line is too long. [117/80]
Open

              Lita.logger.debug("Created New User With User Name [#{glip_user['id']}][#{glip_user_name}]")           

Line is too long. [101/80]
Open

              Lita.logger.debug("Glip API Response: User Name: #{glip_user_name}/#{res.body['id']}.")

Missing top-level class documentation comment.
Open

      class UserCreator

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

There are no issues that match your filters.

Category
Status