peterhudec/authomatic

View on GitHub

Showing 126 of 222 total issues

Function _update_wrapper has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _update_wrapper(wrapper, wrapped,
                        assigned=functools.WRAPPER_ASSIGNMENTS,
                        updated=functools.WRAPPER_UPDATES):
        for attr in assigned:
            try:
Severity: Minor
Found in authomatic/six.py - About 45 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

Avoid deeply nested control flow statements.
Open

                    if access_response.status == 200:
                        if isinstance(access_response.data, list):
                            # Twitter returns the tweets as a JSON list.
                            response.write('Your 5 most recent tweets:')
                            for tweet in access_response.data:
Severity: Major
Found in examples/django/example/simple/views.py - About 45 mins to fix

    Function init has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        init : function (scope, libraries, method, options, response, /* internal */ nc) {
    Severity: Minor
    Found in examples/gae/showcase/static/js/foundation/foundation.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if access_response.status == 200:
                              # Parse response.
                              statuses = access_response.data.get('feed').get('data')
                              error = access_response.data.get('error')
      
      
      Severity: Major
      Found in examples/django/example/simple/views.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if response.status == 200:
                                    # Parse response.
                                    statuses = response.data.get('feed').get('data')
                                    error = response.data.get('error')
        
        
        Severity: Major
        Found in examples/gae/extras/main.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if response.status == 200:
                                      # Parse response.
                                      statuses = response.data.get('feed').get('data')
                                      error = response.data.get('error')
          
          
          Severity: Major
          Found in examples/gae/simple/main.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (this.settings.timer > 0) {
            
                          this.settings.$next_tip
                            .fadeIn(this.settings.tipAnimationFadeSpeed)
                            .show();
            Severity: Major
            Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if response.status == 200:
                                          if isinstance(response.data, list):
                                              # Twitter returns the tweets as a JSON list.
                                              self.response.write(
                                                  'and these are your 5 most recent tweets:')
              Severity: Major
              Found in examples/gae/extras/main.py - About 45 mins to fix

                Function _x_user_parser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _x_user_parser(user, data):
                
                        _user = data.get('query', {}).get('results', {}).get('profile', {})
                
                        user.id = _user.get('guid')
                Severity: Minor
                Found in authomatic/providers/oauth1.py - About 45 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

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, handler, session=None, secret=None,
                Severity: Minor
                Found in authomatic/extras/gae/__init__.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if v and isinstance(v, (list, tuple)):
                                              ax_data[k] = v[0]
                                      data['ax'] = ax_data
                  Severity: Major
                  Found in authomatic/providers/openid.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if response.status == 200:
                                                if isinstance(response.data, list):
                                                    # Twitter returns the tweets as a JSON list.
                                                    self.response.write(
                                                        'Your 5 most recent tweets:')
                    Severity: Major
                    Found in examples/gae/simple/main.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if access_response.status == 200:
                                              if isinstance(access_response.data, list):
                                                  # Twitter returns the tweets as a JSON list.
                                                  response.write('Your 5 most recent tweets:')
                                                  for tweet in access_response.data:
                      Severity: Major
                      Found in examples/pyramid/simple/main.py - About 45 mins to fix

                        Function login has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def login(self, adapter, provider_name, callback=None,
                        Severity: Minor
                        Found in authomatic/core.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  for kk, vv in v.__dict__.iteritems():
                                                      self.response.write(
                                                          '&nbsp;&nbsp;&nbsp;{0}: {1}<br />'.format(kk, vv))
                          
                          
                          Severity: Major
                          Found in examples/gae/dev/main.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if access_response.status == 200:
                                                    # Parse response.
                                                    statuses = access_response.data.get('feed').get('data')
                                                    error = access_response.data.get('error')
                            
                            
                            Severity: Major
                            Found in examples/pyramid/simple/main.py - About 45 mins to fix

                              Function create_signature has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def create_signature(self, method, base, params,
                              Severity: Minor
                              Found in authomatic/providers/oauth1.py - About 35 mins to fix

                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, adapter, secret, name='authomatic', max_age=600,
                                Severity: Minor
                                Found in authomatic/core.py - About 35 mins to fix

                                  Function create_signature has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def create_signature(cls, method, base, params,
                                  Severity: Minor
                                  Found in authomatic/providers/oauth1.py - About 35 mins to fix

                                    Function __new__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __new__(cls, url, method, params, headers, body):
                                    Severity: Minor
                                    Found in authomatic/core.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language