peterhudec/authomatic

View on GitHub
examples/gae/showcase/static/js/authomatic.js

Summary

Maintainability
F
1 mo
Test Coverage

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

        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 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 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 BaseProvider;
              Severity: Major
              Found in examples/gae/showcase/static/js/authomatic.js - About 30 mins to fix

                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

                There are no issues that match your filters.

                Category
                Status