peterhudec/authomatic

View on GitHub

Showing 220 of 220 total issues

Avoid too many return statements within this function.
Open

      return BaseProvider;
Severity: Major
Found in examples/gae/showcase/static/js/authomatic.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return BaseProvider;
    Severity: Major
    Found in javascript/authomatic.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return BaseProvider;
      Severity: Major
      Found in javascript/authomatic.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return WindowsLive;
        Severity: Major
        Found in javascript/authomatic.js - About 30 mins to fix

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

                if (toggle) {
                  this.settings.$next_tip.hide();
                  this.settings.$next_tip.css('visibility', 'visible');
                }
          examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 489..492

          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

          Avoid too many return statements within this function.
          Open

                return el.show();
          Severity: Major
          Found in examples/gae/showcase/static/js/foundation/foundation.reveal.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return WindowsLive;
            Severity: Major
            Found in examples/gae/showcase/static/js/authomatic.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return $(this.scope).width() < 768;
              Severity: Major
              Found in examples/gae/showcase/static/js/foundation/foundation.section.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return Oauth2Provider;
                Severity: Major
                Found in examples/gae/showcase/static/js/authomatic.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return el.hide();
                  Severity: Major
                  Found in examples/gae/showcase/static/js/foundation/foundation.reveal.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return Oauth2Provider;
                    Severity: Major
                    Found in javascript/authomatic.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return BaseProvider;
                      Severity: Major
                      Found in examples/gae/showcase/static/js/authomatic.js - About 30 mins to fix

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

                              if (toggle) {
                                this.settings.$next_tip.hide();
                                this.settings.$next_tip.css('visibility', 'visible');
                              }
                        examples/gae/showcase/static/js/foundation/foundation.joyride.js on lines 446..449

                        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

                        Function _x_user_parser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _x_user_parser(user, data):
                                _birth_date = data.get('birthday')
                                if _birth_date:
                                    try:
                                        user.birth_date = datetime.datetime.strptime(_birth_date,
                        Severity: Minor
                        Found in authomatic/providers/oauth2.py - About 25 mins 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 loop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def loop(handler, obj):
                            handler.response.write('<table>')
                            for k, v in obj.__dict__.items():
                                if not k in ('data', 'gae_user', 'credentials', 'content', 'config'):
                                    style = 'color: red' if not v else ''
                        Severity: Minor
                        Found in examples/gae/tester/main.py - About 25 mins 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 _x_user_parser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _x_user_parser(user, data):
                        
                                _resp = data.get('response', {})
                                _user = _resp.get('user', {})
                        
                        
                        Severity: Minor
                        Found in authomatic/providers/oauth2.py - About 25 mins 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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __init__(self, handler, session=None, secret=None,
                                         cookie_name='webapp2authomatic', backend='memcache',
                                         config=None):
                                """
                                .. warning::
                        Severity: Minor
                        Found in authomatic/extras/gae/__init__.py - About 25 mins 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 _access_user_info has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _access_user_info(self):
                                """
                                Email is available in separate method so second request is needed.
                                """
                                response = super(Bitbucket, self)._access_user_info()
                        Severity: Minor
                        Found in authomatic/providers/oauth1.py - About 25 mins 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 exec_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def exec_(_code_, _globs_=None, _locs_=None):
                                """Execute code in a namespace."""
                                if _globs_ is None:
                                    frame = sys._getframe(1)
                                    _globs_ = frame.f_globals
                        Severity: Minor
                        Found in authomatic/six.py - About 25 mins 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 _x_user_parser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _x_user_parser(user, data):
                                emails = data.get('emails', [])
                                if emails:
                                    user.email = emails[0].get('value')
                                    for email in emails:
                        Severity: Minor
                        Found in authomatic/providers/oauth2.py - About 25 mins 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