peterhudec/authomatic

View on GitHub

Showing 126 of 222 total issues

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

;(function ($, window, document, undefined) {
  'use strict';

  Foundation.libs = Foundation.libs || {};

Severity: Minor
Found in examples/gae/showcase/static/js/foundation/foundation.orbit.js - About 3 hrs to fix

    Function onLoginComplete has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            onLoginComplete: function(result) {
                // Scroll the window to bottom of the #sub-header.
                var $subHeader = $("#sub-header");
                var position = $subHeader.offset().top + $subHeader.height();
                $("html, body").animate({scrollTop: position }, 'slow', function(){
    Severity: Major
    Found in examples/gae/showcase/static/js/app.js - About 3 hrs to fix

      Function login_decorator has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      def login_decorator(func):
          """
          Decorate the :meth:`.BaseProvider.login` implementations with this
          decorator.
      
      
      Severity: Minor
      Found in authomatic/providers/__init__.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

      Function events has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          events : function () {
            var self = this;
      
            $(this.scope)
              .on('change.fndtn.forms', 'form.custom select:not([data-customforms="disabled"])', function (e) {
      Severity: Major
      Found in examples/gae/showcase/static/js/foundation/foundation.forms.js - About 3 hrs to fix

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

            def create_request_elements(
                    cls, request_type, credentials, url, params=None, headers=None,
                    body='', method='GET', verifier='', callback=''
            ):
                """
        Severity: Minor
        Found in authomatic/providers/oauth1.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

        Function any has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def any(self, provider_name):
        
                result = authomatic.login(Webapp2Adapter(self), provider_name)
        
                if result:
        Severity: Minor
        Found in examples/gae/tester/main.py - About 2 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 events has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            events : function () {
              var self = this;
              var offst = this.outerHeight($('.top-bar'));
              $(this.scope)
                .on('click.fndtn.topbar', '.top-bar .toggle-topbar', function (e) {
        Severity: Major
        Found in examples/gae/showcase/static/js/foundation/foundation.topbar.js - About 2 hrs to fix

          File config-template.py has 279 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          """
          Keys with leading underscore are our custom provider-specific data.
          """
          
          
          Severity: Minor
          Found in examples/gae/showcase/config-template.py - About 2 hrs to fix

            Function events has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                events : function () {
                  var self = this;
                  $(this.scope).on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) {
                    var $destination = $(this),
                        $expedition = $destination.closest('[data-magellan-expedition]'),
            Severity: Major
            Found in examples/gae/showcase/static/js/foundation/foundation.magellan.js - About 2 hrs to fix

              Function _update_or_create_user has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _update_or_create_user(self, data, credentials=None, content=None):
                      """
                      Updates or creates :attr:`.user`.
              
                      :returns:
              Severity: Minor
              Found in authomatic/providers/__init__.py - About 2 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.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Foundation Responsive Library
               * http://foundation.zurb.com
               * Copyright 2013, ZURB
               * Free to use under the MIT license.
              Severity: Minor
              Found in examples/gae/showcase/static/js/foundation/foundation.js - About 2 hrs to fix

                BaseProvider has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class BaseProvider(object):
                    """
                    Abstract base class for all providers.
                    """
                
                
                Severity: Minor
                Found in authomatic/providers/__init__.py - About 2 hrs to fix

                  File foundation.forms.js has 270 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.forms.js - About 2 hrs to fix

                    Function show has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        show : function (init) {
                          var $timer = null;
                    
                          // are we paused?
                          if (this.settings.$li === undefined
                    Severity: Major
                    Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 2 hrs to fix

                      Function append_custom_select has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          append_custom_select : function (idx, sel) {
                            var self = Foundation.libs.forms,
                                $this = $( sel ),
                                $customSelect = $this.next( 'div.custom.dropdown' ),
                                $customList = $customSelect.find( 'ul' ),
                      Severity: Major
                      Found in examples/gae/showcase/static/js/foundation/foundation.forms.js - About 2 hrs to fix

                        Function backend has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def backend(self, adapter):
                                """
                                Converts a *request handler* to a JSON backend which you can use with
                                :ref:`authomatic.js <js>`.
                        
                        
                        Severity: Minor
                        Found in authomatic/core.py - About 2 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 _fetch has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _fetch(self, url, method='GET', params=None, headers=None,
                                       body='', max_redirects=5, content_parser=None,
                                       certificate_file=None, ssl_verify=True):
                                """
                                Fetches a URL.
                        Severity: Minor
                        Found in authomatic/providers/__init__.py - About 2 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 _goto has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _goto: function($slides_container, index_or_direction, callback) {
                              var self = this,
                                  $container = $slides_container.parent(),
                                  $slides = $slides_container.children(),
                                  $active_slide = $slides_container.find('.' + self.settings.active_slide_class),
                        Severity: Major
                        Found in examples/gae/showcase/static/js/foundation/foundation.orbit.js - About 2 hrs to fix

                          Function access has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def access(self, url, **kwargs):
                                  # https://developer.github.com/v3/#user-agent-required
                                  # GitHub requires that all API requests MUST include a valid ``User-Agent`` header.
                                  headers = kwargs["headers"] = kwargs.get("headers", {})
                                  if not headers.get("User-Agent"):
                          Severity: Minor
                          Found in authomatic/providers/oauth2.py - About 2 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 pos_default has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              pos_default : function (init) {
                                var half_fold = Math.ceil($(window).height() / 2),
                                    tip_position = this.settings.$next_tip.offset(),
                                    $nub = this.settings.$next_tip.find('.joyride-nub'),
                                    nub_height = Math.ceil(this.outerHeight($nub) / 2),
                          Severity: Minor
                          Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language