stormpath/stormpath-rails

View on GitHub

Showing 5 of 29 total issues

Method stormpath_rails_routes has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

      def stormpath_rails_routes(actions: {})
        actions = STORMPATH_DEFAULT_ACTIONS_MAP.merge(actions)

        constraints Stormpath::Rails::RoutingConstraint do
          if Stormpath::Rails.config.web.register.enabled
Severity: Minor
Found in lib/stormpath/rails/router.rb - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method stormpath_rails_routes has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def stormpath_rails_routes(actions: {})
        actions = STORMPATH_DEFAULT_ACTIONS_MAP.merge(actions)

        constraints Stormpath::Rails::RoutingConstraint do
          if Stormpath::Rails.config.web.register.enabled
Severity: Minor
Found in lib/stormpath/rails/router.rb - About 1 hr to fix

    Method call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def call
              response.headers['Cache-Control'] = 'no-store'
              response.headers['Pragma'] = 'no-cache'
    
              case grant_type
    Severity: Minor
    Found in app/controllers/stormpath/rails/oauth2/create_controller.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method check_env_variable_names has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def self.check_env_variable_names
            unless Stormpath::Rails::EnvNamesWarning.test_missing_required_env_vars.empty?
              warn_message = "\n\n"
              40.times { warn_message << '*' }
              warn_message << 'STORMPATH RAILS'
    Severity: Minor
    Found in lib/stormpath/rails/env_names_warning.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def call
              begin
                if id_site_result.status == 'LOGOUT'
                  TokenAndCookiesCleaner.new(cookies).remove
                elsif id_site_result.status == 'AUTHENTICATED'
    Severity: Minor
    Found in app/controllers/stormpath/rails/id_site_callback/new_controller.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language