peterhudec/authomatic

View on GitHub

Showing 220 of 220 total issues

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

          var data = {
            start_page_x: e.touches[0].pageX,
            start_page_y: e.touches[0].pageY,
            start_time: (new Date()).getTime(),
            delta_x: 0,
examples/gae/showcase/static/js/foundation/foundation.clearing.js on lines 105..111

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 67.

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

          var data = {
                start_page_x: e.touches[0].pageX,
                start_page_y: e.touches[0].pageY,
                start_time: (new Date()).getTime(),
                delta_x: 0,
examples/gae/showcase/static/js/foundation/foundation.orbit.js on lines 189..195

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 67.

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 end is not None:
            if isinstance(end, unicode):
                want_unicode = True
            elif not isinstance(end, str):
                raise TypeError("end must be None or a string")
Severity: Major
Found in authomatic/six.py and 1 other location - About 1 hr to fix
authomatic/six.py on lines 727..731

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 45.

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 sep is not None:
            if isinstance(sep, unicode):
                want_unicode = True
            elif not isinstance(sep, str):
                raise TypeError("sep must be None or a string")
Severity: Major
Found in authomatic/six.py and 1 other location - About 1 hr to fix
authomatic/six.py on lines 733..737

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 45.

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 (this.top()) {

            this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height});
            $nub.addClass('bottom');

examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 478..483

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 66.

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

        } else {

          this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height});
          $nub.addClass('top');

examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 473..478

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 66.

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 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,

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

                          $container
                            .on('orbit:after-slide-change.fndtn.orbit', function(e, orbit) {
                              var $slide_number = $container.find('.' + self.settings.slide_number_class);
                    
                              if ($slide_number.length === 1) {
                    examples/gae/showcase/static/js/foundation/foundation.orbit.js on lines 157..174

                    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 62.

                    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

                    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

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

                              try:
                                  user.birth_date = datetime.datetime.strptime(
                                      data.get('birthday'), "%Y-%m-%d")
                              except ValueError:
                                  user.birth_date = data.get('birthday')
                      Severity: Major
                      Found in authomatic/providers/oauth2.py and 1 other location - About 1 hr to fix
                      authomatic/providers/oauth2.py on lines 1999..2003

                      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 42.

                      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

                              try:
                                  user.birth_date = datetime.datetime.strptime(
                                      _user.get('birth_date'), "%B %d")
                              except ValueError:
                                  user.birth_date = _user.get('birth_date')
                      Severity: Major
                      Found in authomatic/providers/oauth2.py and 1 other location - About 1 hr to fix
                      authomatic/providers/oauth2.py on lines 2068..2072

                      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 42.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language