peterhudec/authomatic

View on GitHub

Showing 220 of 220 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  } else if ($associatedElement.attr('type') === 'radio') {
                    e.preventDefault();
                    $customRadio = $(this).find('span.custom.radio');
                    //the radio might be outside after the label
                    if ($customRadio.length == 0) {
      examples/gae/showcase/static/js/foundation/foundation.forms.js on lines 56..81

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 120.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  if ($associatedElement.attr('type') === 'checkbox') {
                    e.preventDefault();
                    $customCheckbox = $(this).find('span.custom.checkbox');
      
                    //the checkbox might be outside after the label
      examples/gae/showcase/static/js/foundation/foundation.forms.js on lines 69..81

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 120.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                return this.delay(function () {
                  return el
                    .animate(end_css, this.settings.animationSpeed, 'linear', function () {
                      this.locked = false;
                      el.css(css).trigger('closed');
      examples/gae/showcase/static/js/foundation/foundation.reveal.js on lines 200..207

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                return this.delay(function () {
                  return el
                    .css(css)
                    .animate(end_css, this.settings.animationSpeed, 'linear', function () {
                      this.locked = false;
      examples/gae/showcase/static/js/foundation/foundation.reveal.js on lines 155..163

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                return this.delay(function () {
                  return el
                    .animate(end_css, this.settings.animationSpeed, 'linear', function () {
                      this.locked = false;
                      el.css(css).trigger('closed');
      examples/gae/showcase/static/js/foundation/foundation.reveal.js on lines 213..220

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                return this.delay(function () {
                  return el
                    .css(css)
                    .animate(end_css, this.settings.animationSpeed, 'linear', function () {
                      this.locked = false;
      examples/gae/showcase/static/js/foundation/foundation.reveal.js on lines 169..177

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 110.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

        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

          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 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
                  Severity
                  Category
                  Status
                  Source
                  Language