peterhudec/authomatic

View on GitHub

Showing 124 of 220 total issues

Function contactProvider has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    BaseProvider.prototype.contactProvider = function(requestElements) {
      var body, headers, jsonpOptions, method, options, params, url,
        _this = this;

      url = requestElements.url, method = requestElements.method, params = requestElements.params, headers = requestElements.headers, body = requestElements.body;
Severity: Minor
Found in examples/gae/showcase/static/js/authomatic.js - About 1 hr to fix

    Function contactProvider has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        BaseProvider.prototype.contactProvider = function(requestElements) {
          var body, headers, jsonpOptions, method, options, params, url,
            _this = this;
    
          url = requestElements.url, method = requestElements.method, params = requestElements.params, headers = requestElements.headers, body = requestElements.body;
    Severity: Minor
    Found in javascript/authomatic.js - About 1 hr to fix

      Function toggle_active has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          toggle_active : function (e, self) {
            var $this = $(this),
                section = $this.closest('section, .section'),
                content = section.find('.content'),
                parent = section.closest('[data-section]'),
      Severity: Minor
      Found in examples/gae/showcase/static/js/foundation/foundation.section.js - About 1 hr to fix

        Function get has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def get(self):
                # Create links to the Login handler.
                self.response.write('Login with <a href="login/fb">Facebook</a> or ')
                self.response.write('<a href="login/tw">Twitter</a>')
        
        
        Severity: Minor
        Found in examples/gae/credentials/main.py - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def login(self):
                # get request parameters from which we can determine the login phase
                denied = self.params.get('denied')
                verifier = self.params.get('oauth_verifier', '')
                request_token = self.params.get('oauth_token', '')
        Severity: Minor
        Found in authomatic/providers/oauth1.py - About 1 hr 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 create_request_elements has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create_request_elements(
        Severity: Major
        Found in authomatic/providers/oauth2.py - About 1 hr to fix

          Function swipe_events has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              swipe_events : function () {
                var self = this;
          
                $(this.scope)
                  .on('touchstart.fndtn.clearing', '.visible-img', function(e) {
          Severity: Minor
          Found in examples/gae/showcase/static/js/foundation/foundation.clearing.js - About 1 hr to fix

            Function __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
                    super(MovedAttribute, self).__init__(name)
                    if PY3:
                        if new_mod is None:
                            new_mod = name
            Severity: Minor
            Found in authomatic/six.py - About 1 hr 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 resize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                resize : function () {
                  var sections = $('[data-section]'),
                      self = Foundation.libs.section;
            
                  sections.each(function() {
            Severity: Minor
            Found in examples/gae/showcase/static/js/foundation/foundation.section.js - About 1 hr to fix

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

                  show : function (el, css) {
                    // is modal
                    if (css) {
                      if (/pop/i.test(this.settings.animation)) {
                        css.top = $(window).scrollTop() - el.data('offset') + 'px';
              Severity: Minor
              Found in examples/gae/showcase/static/js/foundation/foundation.reveal.js - About 1 hr to fix

                Function start has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    start : function () {
                      var self = this,
                          $this = $(this.scope).find('[data-joyride]'),
                          integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
                          int_settings_count = integer_settings.length;
                Severity: Minor
                Found in examples/gae/showcase/static/js/foundation/foundation.joyride.js - About 1 hr to fix

                  Function reposition has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      reposition : function (target, tip, classes) {
                        var width, nub, nubHeight, nubWidth, column, objPos;
                  
                        tip.css('visibility', 'hidden').show();
                  
                  
                  Severity: Minor
                  Found in examples/gae/showcase/static/js/foundation/foundation.tooltips.js - About 1 hr to fix

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

                        def __init__(
                    Severity: Major
                    Found in authomatic/core.py - About 1 hr to fix

                      Function init has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          init : function (scope, method, options) {
                            var self = this;
                            this.scope = scope || this.scope;
                      
                            if (typeof method === 'object') {
                      Severity: Minor
                      Found in examples/gae/showcase/static/js/foundation/foundation.tooltips.js - About 1 hr to fix

                        Function setPlaceholder has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function setPlaceholder() {
                                var $replacement,
                                    input = this,
                                    $input = $(input),
                                    $origInput = $input,

                          Consider simplifying this complex logical expression.
                          Open

                                  if authorization_code or not self.user_authorization_url:
                          
                                      if authorization_code:
                                          # =============================================================
                                          # Phase 2 after redirect with success
                          Severity: Critical
                          Found in authomatic/providers/oauth2.py - About 1 hr to fix

                            Function access has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                BaseProvider.prototype.access = function() {
                                  var callback,
                                    _this = this;
                            
                                  callback = function(data, textStatus, jqXHR) {
                            Severity: Minor
                            Found in javascript/authomatic.js - About 1 hr to fix

                              Function hide has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  hide : function (el, css) {
                                    // is modal
                                    if (css) {
                                      if (/pop/i.test(this.settings.animation)) {
                                        var end_css = {
                              Severity: Minor
                              Found in examples/gae/showcase/static/js/foundation/foundation.reveal.js - About 1 hr to fix

                                Function access has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    BaseProvider.prototype.access = function() {
                                      var callback,
                                        _this = this;
                                
                                      callback = function(data, textStatus, jqXHR) {
                                Severity: Minor
                                Found in examples/gae/showcase/static/js/authomatic.js - About 1 hr to fix

                                  Function __repr__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def __repr__(self):
                                  
                                          # get class name
                                          name = self.__class__.__name__
                                  
                                  
                                  Severity: Minor
                                  Found in authomatic/core.py - About 1 hr 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