peterhudec/authomatic

View on GitHub

Showing 124 of 220 total issues

File oauth2.py has 1561 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
"""
|oauth2| Providers
-------------------

Severity: Major
Found in authomatic/providers/oauth2.py - About 4 days to fix

    File core.py has 1191 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    import collections
    import copy
    import datetime
    Severity: Major
    Found in authomatic/core.py - About 3 days to fix

      File oauth1.py has 1042 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      """
      |oauth1| Providers
      --------------------
      
      
      Severity: Major
      Found in authomatic/providers/oauth1.py - About 2 days to fix

        File __init__.py has 730 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        """
        Abstract Classes for Providers
        ------------------------------
        
        
        Severity: Major
        Found in authomatic/providers/__init__.py - About 1 day to fix

          File six.py has 646 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          """Utilities for writing code that runs on Python 2 and 3"""
          
          # Copyright (c) 2010-2015 Benjamin Peterson
          #
          Severity: Major
          Found in authomatic/six.py - About 1 day to fix

            Function login has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
            Open

            def login(request, provider_name):
                # We we need the response object for the adapter.
                response = HttpResponse()
            
                # Start the login procedure.
            Severity: Minor
            Found in examples/django/example/simple/views.py - About 1 day 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 login has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
            Open

            def login(request):
            
                # We will need the response to pass it to the WebObAdapter.
                response = Response()
            
            
            Severity: Minor
            Found in examples/pyramid/simple/main.py - About 1 day 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 any has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
            Open

                def any(self, provider_name):
            
                    # It all begins with login.
                    result = authomatic.login(Webapp2Adapter(self), provider_name)
            
            
            Severity: Minor
            Found in examples/gae/simple/main.py - About 1 day 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 any has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

                def any(self, provider_name):
            
                    session = gae.Webapp2Session(self, secret='abc')
            
                    # It all begins with login.
            Severity: Minor
            Found in examples/gae/extras/main.py - About 1 day 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 print_ has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
            Open

                def print_(*args, **kwargs):
                    """The new-style print function for Python 2.4 and 2.5."""
                    fp = kwargs.pop("file", sys.stdout)
                    if fp is None:
                        return
            Severity: Minor
            Found in authomatic/six.py - About 7 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

            File foundation.joyride.js has 458 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*jslint unparam: true, browser: true, indent: 2 */
            
            ;(function ($, window, document, undefined) {
              'use strict';
            
            
            Severity: Minor
            Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 7 hrs to fix

              File authomatic.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // Generated by CoffeeScript 1.6.2
              /*
              # CoffeeDoc example documentation #
              
              This is a module-level docstring, and will be displayed at the top of the module documentation.
              Severity: Minor
              Found in javascript/authomatic.js - About 6 hrs to fix

                File authomatic.js has 428 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // Generated by CoffeeScript 1.6.2
                /*
                # CoffeeDoc example documentation #
                
                This is a module-level docstring, and will be displayed at the top of the module documentation.
                Severity: Minor
                Found in examples/gae/showcase/static/js/authomatic.js - About 6 hrs to fix

                  Function login has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def login(self):
                          # Instantiate consumer
                          self.store._log = self._log
                          oi_consumer = consumer.Consumer(self.session, self.store)
                  
                  
                  Severity: Minor
                  Found in authomatic/providers/openid.py - About 6 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

                  File foundation.clearing.js has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*jslint unparam: true, browser: true, indent: 2 */
                  
                  ;(function ($, window, document, undefined) {
                    'use strict';
                  
                  
                  Severity: Minor
                  Found in examples/gae/showcase/static/js/foundation/foundation.clearing.js - About 4 hrs to fix

                    Function callback has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def callback(self, event):
                    
                            headers(self)
                    
                            if event.error:
                    Severity: Minor
                    Found in examples/gae/dev/main.py - About 4 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

                    File openid.py has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # -*- coding: utf-8 -*-
                    """
                    |openid| Providers
                    ----------------------------------
                    
                    
                    Severity: Minor
                    Found in authomatic/providers/openid.py - About 4 hrs to fix

                      Function login has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def login(self):
                      
                              # get request parameters from which we can determine the login phase
                              authorization_code = self.params.get('code')
                              error = self.params.get('error')
                      Severity: Minor
                      Found in authomatic/providers/oauth2.py - About 4 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

                      Function _init_events has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _init_events: function ($slides_container) {
                            var self = this,
                                $container = $slides_container.parent();
                      
                            $(window)
                      Severity: Major
                      Found in examples/gae/showcase/static/js/foundation/foundation.orbit.js - About 3 hrs to fix

                        Function create_request_elements has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def create_request_elements(
                                    cls, request_type, credentials, url, method='GET', params=None,
                                    headers=None, body='', secret=None, redirect_uri='', scope='',
                                    csrf='', user_state=''
                            ):
                        Severity: Minor
                        Found in authomatic/providers/oauth2.py - 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

                        Severity
                        Category
                        Status
                        Source
                        Language