sahat/satellizer

View on GitHub

Showing 562 of 562 total issues

Function LoginWithGoogle has 93 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func LoginWithGoogle(w http.ResponseWriter, r *http.Request) {

    accessTokenUrl := "https://accounts.google.com/o/oauth2/token"
    peopleApiUrl := "https://www.googleapis.com"
    peopleApiPath := "/plus/v1/people/me/openIdConnect"
Severity: Major
Found in examples/server/go/oauth2.go - About 2 hrs to fix

    Function getLoader has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function getLoader() {
        if (!loaderInstance) {
          loaderInstance = $ionicTemplateLoader.compile({
            template: LOADING_TPL,
            appendTo: $ionicBody.get()
    Severity: Major
    Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 2 hrs to fix

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

          getScale: function getScale(start, end) {
            // need two fingers...
            if(start.length >= 2 && end.length >= 2) {
              return this.getDistance(end[0], end[1]) /
                this.getDistance(start[0], start[1]);
      Severity: Major
      Found in examples/ionic/www/lib/ionic/js/ionic.js and 2 other locations - About 2 hrs to fix
      examples/ionic/www/lib/ionic/js/ionic.js on lines 1282..1289
      examples/ionic/www/lib/ionic/js/ionic.js on lines 6839..6846

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

      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 3 locations. Consider refactoring.
      Open

          getRotation: function getRotation(start, end) {
            // need two fingers
            if(start.length >= 2 && end.length >= 2) {
              return this.getAngle(end[1], end[0]) -
                this.getAngle(start[1], start[0]);
      Severity: Major
      Found in examples/ionic/www/lib/ionic/js/ionic.js and 2 other locations - About 2 hrs to fix
      examples/ionic/www/lib/ionic/js/ionic.js on lines 1266..1273
      examples/ionic/www/lib/ionic/js/ionic.js on lines 6839..6846

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

      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 3 locations. Consider refactoring.
      Open

        __getScale: function getScale(start, end) {
          // need two fingers...
          if (start.length >= 2 && end.length >= 2) {
            return this.__getDistance(end[0], end[1]) /
              this.__getDistance(start[0], start[1]);
      Severity: Major
      Found in examples/ionic/www/lib/ionic/js/ionic.js and 2 other locations - About 2 hrs to fix
      examples/ionic/www/lib/ionic/js/ionic.js on lines 1266..1273
      examples/ionic/www/lib/ionic/js/ionic.js on lines 1282..1289

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

      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 has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function init() {
                var listView = listCtrl.listView = new ionic.views.ListView({
                  el: $element[0],
                  listEl: $element.children()[0],
                  scrollEl: scrollCtrl && scrollCtrl.element,
      Severity: Major
      Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 2 hrs to fix

        Function dragGesture has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            handler: function dragGesture(ev, inst) {
              if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {
                this.preventedFirstMove = false;
        
              } else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {
        Severity: Major
        Found in examples/ionic/www/lib/ionic/js/ionic.js - About 2 hrs to fix

          Function doTouchEnd has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            doTouchEnd: function(e, timeStamp) {
              if (timeStamp instanceof Date) {
                timeStamp = timeStamp.valueOf();
              }
              if (typeof timeStamp !== "number") {
          Severity: Major
          Found in examples/ionic/www/lib/ionic/js/ionic.js - About 2 hrs to fix

            Method from_auth has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.from_auth(params, current_user)
                params = params.smash.with_indifferent_access
                authorization = Authorization.find_or_initialize_by(provider: params[:provider], uid: params[:uid])
                if authorization.persisted?
                  if current_user
            Severity: Minor
            Found in examples/server/ruby/app/models/user.rb - 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 createPopup has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function createPopup(options) {
                options = extend({
                  scope: null,
                  title: '',
                  buttons: []
            Severity: Major
            Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 2 hrs to fix

              Function $get has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $get: ['$q', function($q) {
                    var self = {
              
                      /**
                       * @ngdoc method
              Severity: Major
              Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 2 hrs to fix

                Function OAuth1 has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var OAuth1 = (function () {
                        function OAuth1($http, $window, SatellizerConfig, SatellizerPopup) {
                            this.$http = $http;
                            this.$window = $window;
                            this.SatellizerConfig = SatellizerConfig;
                Severity: Major
                Found in examples/ionic/www/lib/satellizer/dist/satellizer.js - About 2 hrs to fix

                  Function DelegateService has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    ionic.DelegateService = function(methodNames) {
                  
                      if (methodNames.indexOf('$getByHandle') > -1) {
                        throw new Error("Method '$getByHandle' is implicitly added to each delegate service. Do not list it as a method.");
                      }
                  Severity: Major
                  Found in examples/ionic/www/lib/ionic/js/ionic.js - About 2 hrs to fix

                    Function __stepThroughDeceleration has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      __stepThroughDeceleration: function(render) {
                        var self = this;
                    
                    
                        //
                    Severity: Major
                    Found in examples/ionic/www/lib/ionic/js/ionic.js - About 2 hrs to fix

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

                                      facebook: {
                                          name: 'facebook',
                                          url: '/auth/facebook',
                                          authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog/oauth',
                                          redirectUri: window.location.origin + '/',
                      Severity: Major
                      Found in examples/ionic/www/lib/satellizer/dist/satellizer.js and 1 other location - About 2 hrs to fix
                      examples/ionic/www/lib/satellizer/satellizer.js on lines 34..45

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

                      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

                              facebook: {
                                name: 'facebook',
                                url: '/auth/facebook',
                                authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog/oauth',
                                redirectUri: window.location.origin + '/',
                      Severity: Major
                      Found in examples/ionic/www/lib/satellizer/satellizer.js and 1 other location - About 2 hrs to fix
                      examples/ionic/www/lib/satellizer/dist/satellizer.js on lines 27..38

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

                      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

                      IonicModule
                      .directive('navTransition', ['$ionicViewSwitcher', function($ionicViewSwitcher) {
                        return {
                          restrict: 'A',
                          priority: 1000,
                      Severity: Major
                      Found in examples/ionic/www/lib/ionic/js/ionic-angular.js and 1 other location - About 2 hrs to fix
                      examples/ionic/www/lib/ionic/js/ionic-angular.js on lines 11209..11220

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

                      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

                      IonicModule
                      .directive('navDirection', ['$ionicViewSwitcher', function($ionicViewSwitcher) {
                        return {
                          restrict: 'A',
                          priority: 1000,
                      Severity: Major
                      Found in examples/ionic/www/lib/ionic/js/ionic-angular.js and 1 other location - About 2 hrs to fix
                      examples/ionic/www/lib/ionic/js/ionic-angular.js on lines 11311..11322

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

                      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

                          payload = dict(client_id=request.json['clientId'],
                                         redirect_uri=request.json['redirectUri'],
                                         client_secret=app.config['LINKEDIN_SECRET'],
                                         code=request.json['code'],
                      Severity: Major
                      Found in examples/server/python/app.py and 1 other location - About 2 hrs to fix
                      examples/server/python/app.py on lines 266..269

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

                      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

                          payload = dict(client_id=request.json['clientId'],
                                         redirect_uri=request.json['redirectUri'],
                                         client_secret=app.config['GOOGLE_SECRET'],
                                         code=request.json['code'],
                      Severity: Major
                      Found in examples/server/python/app.py and 1 other location - About 2 hrs to fix
                      examples/server/python/app.py on lines 321..324

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

                      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