ringcentral-ruby/lita-glip

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

Summary

Maintainability
A
1 hr
Test Coverage

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

        def initialize(robot, app_key, app_secret, server, username, extension, password, token)
          @robot = robot
          @logger_prefix = " -- #{self.class.name}: "
          @rc_sdk = RingCentralSdk::REST::Client.new do |config|
            config.app_key = app_key
Severity: Minor
Found in lib/lita/adapters/glip/connector.rb by rubocop

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.

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

        def client_connect
          Lita.logger.info("#{@logger_prefix}Authorizing with RingCentral.")
          if @token.nil?
            @rc_sdk.authorize_password @username, @extension, @password
            token = MultiJson.encode @rc_sdk.token.to_hash
Severity: Minor
Found in lib/lita/adapters/glip/connector.rb by rubocop

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.

Assignment Branch Condition size for client_connect is too high. [17.29/15]
Open

        def client_connect
          Lita.logger.info("#{@logger_prefix}Authorizing with RingCentral.")
          if @token.nil?
            @rc_sdk.authorize_password @username, @extension, @password
            token = MultiJson.encode @rc_sdk.token.to_hash
Severity: Minor
Found in lib/lita/adapters/glip/connector.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

Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def initialize(robot, app_key, app_secret, server, username, extension, password, token)
Severity: Major
Found in lib/lita/adapters/glip/connector.rb - About 1 hr to fix

    Avoid parameter lists longer than 5 parameters. [8/5]
    Open

            def initialize(robot, app_key, app_secret, server, username, extension, password, token)
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

    Line is too long. [82/80]
    Open

                Lita.logger.debug("#{@logger_prefix}Authorized with token: #{token}.")
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    Line is too long. [87/80]
    Open

                Lita.logger.debug("#{@logger_prefix}Send Message To Glip From Lita: #{s}.")
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    Missing top-level class documentation comment.
    Open

          class Connector
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    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

    Final newline missing.
    Open

    end
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    Line is too long. [96/80]
    Open

            def initialize(robot, app_key, app_secret, server, username, extension, password, token)
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    Extra empty line detected at class body end.
    Open

    
          end
    Severity: Minor
    Found in lib/lita/adapters/glip/connector.rb by rubocop

    This cops checks if empty lines around the bodies of classes match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    class Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    class Foo
      class Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    class Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    class Foo
      def bar
        # ...
      end
    end

    There are no issues that match your filters.

    Category
    Status