peterhudec/authomatic

View on GitHub

Showing 220 of 220 total issues

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

(function() {
  var $, Authomatic, BaseProvider, Flickr, Foursquare, Google, LinkedIn, Oauth1Provider, Oauth2Provider, WindowsLive, deserializeCredentials, format, getProviderClass, globalOptions, jsonPCallbackCounter, log, openWindow, parseQueryString, parseUrl, _ref, _ref1, _ref2, _ref3, _ref4, _ref5,
    __slice = [].slice,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
Severity: Major
Found in javascript/authomatic.js and 1 other location - About 1 mo to fix
examples/gae/showcase/static/js/authomatic.js on lines 12..520

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

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

(function() {
  var $, Authomatic, BaseProvider, Flickr, Foursquare, Google, LinkedIn, Oauth1Provider, Oauth2Provider, WindowsLive, deserializeCredentials, format, getProviderClass, globalOptions, jsonPCallbackCounter, log, openWindow, parseQueryString, parseUrl, _ref, _ref1, _ref2, _ref3, _ref4, _ref5,
    __slice = [].slice,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
Severity: Major
Found in examples/gae/showcase/static/js/authomatic.js and 1 other location - About 1 mo to fix
javascript/authomatic.js on lines 12..520

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

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

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

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

                            if result.provider.name == 'fb':
        
                                self.response.write(
                                    'Your are logged in with Facebook,<br />')
        
        
        Severity: Major
        Found in examples/gae/extras/main.py and 1 other location - About 2 days to fix
        examples/gae/simple/main.py on lines 58..93

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

        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 result.provider.name == 'fb':
                                self.response.write(
                                    'Your are logged in with Facebook.<br />')
        
                                # We will access the user's 5 most recent statuses.
        Severity: Major
        Found in examples/gae/simple/main.py and 1 other location - About 2 days to fix
        examples/gae/extras/main.py on lines 64..100

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

        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

                        if result.provider.name == 'fb':
                            response.write('Your are logged in with Facebook.<br />')
        
                            # We will access the user's 5 most recent statuses.
                            url = 'https://graph.facebook.com/{0}?fields=feed.limit(5)'
        Severity: Major
        Found in examples/pyramid/simple/main.py and 1 other location - About 2 days to fix
        examples/django/example/simple/views.py on lines 65..95

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

        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

                        if result.provider.name == 'fb':
                            response.write('Your are logged in with Facebook.<br />')
        
                            # We will access the user's 5 most recent statuses.
                            url = 'https://graph.facebook.com/{0}?fields=feed.limit(5)'
        Severity: Major
        Found in examples/django/example/simple/views.py and 1 other location - About 2 days to fix
        examples/pyramid/simple/main.py on lines 58..88

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

        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

        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

                  Severity
                  Category
                  Status
                  Source
                  Language