sahat/satellizer

View on GitHub

Showing 562 of 562 total issues

Consider simplifying this complex logical expression.
Open

      } else if (currentView && currentView.historyId !== historyId &&
                hist.cursor > -1 && hist.stack.length > 0 && hist.cursor < hist.stack.length &&
                hist.stack[hist.cursor].stateId === currentStateId) {
        // they just changed to a different history and the history already has views in it
        var switchToView = hist.stack[hist.cursor];
Severity: Major
Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

              if (nativeScrolling) {
                // use native scrolling
                $element.addClass('overflow-scroll');
    
                scrollViewOptions = {
    Severity: Major
    Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 1 hr to fix

      Function LoginWithTwitter has 10 return statements (exceeds 4 allowed).
      Open

      func LoginWithTwitter(w http.ResponseWriter, r *http.Request) {
      
          c := oauth.NewConsumer(
              config.TWITTER_KEY,
              config.TWITTER_SECRET,
      Severity: Major
      Found in examples/server/go/oauth.go - About 1 hr to fix

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

                        twitter: {
                            name: 'twitter',
                            url: '/auth/twitter',
                            authorizationEndpoint: 'https://api.twitter.com/oauth/authenticate',
                            redirectUri: window.location.origin,
        Severity: Major
        Found in examples/ionic/www/lib/satellizer/dist/satellizer.js and 1 other location - About 1 hr to fix
        examples/ionic/www/lib/satellizer/satellizer.js on lines 97..104

        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

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

                twitter: {
                  name: 'twitter',
                  url: '/auth/twitter',
                  authorizationEndpoint: 'https://api.twitter.com/oauth/authenticate',
                  redirectUri: window.location.origin,
        Severity: Major
        Found in examples/ionic/www/lib/satellizer/satellizer.js and 1 other location - About 1 hr to fix
        examples/ionic/www/lib/satellizer/dist/satellizer.js on lines 87..94

        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

        Function performAnimation has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
        Severity: Major
        Found in examples/ionic/www/lib/ionic/js/angular/angular-animate.js - About 1 hr to fix

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

                getContentHeight: function() {
                  return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));
                }
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 6884..6886

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

          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 (keyboardHasPlugin()) {
              window.addEventListener('native.keyboardshow', debouncedKeyboardNativeShow);
              window.addEventListener('native.keyboardhide', keyboardFocusOut);
            } else {
              document.body.addEventListener('focusout', keyboardFocusOut);
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 3644..3649

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

          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

                  getContentHeight: function() {
                    return Math.max(self.__content.scrollHeight, self.__content.offsetHeight + (self.__content.offsetTop * 2));
                  }
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 4755..4757

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

          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 (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {
                self.__didWaitForSize = true;
                self.__waitForSize();
              }
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 7140..7143

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

          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 (keyboardHasPlugin()) {
                window.removeEventListener('native.keyboardshow', debouncedKeyboardNativeShow );
                window.removeEventListener('native.keyboardhide', keyboardFocusOut);
              } else {
                document.body.removeEventListener('focusout', keyboardFocusOut);
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 3688..3693

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

          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 (!self.__didWaitForSize && !self.__maxScrollLeft && !self.__maxScrollTop) {
                  self.__didWaitForSize = true;
                  self.__waitForSize();
                }
          Severity: Minor
          Found in examples/ionic/www/lib/ionic/js/ionic.js and 1 other location - About 55 mins to fix
          examples/ionic/www/lib/ionic/js/ionic.js on lines 6586..6589

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

          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 LoginWithGoogle has 9 return statements (exceeds 4 allowed).
          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 55 mins to fix

            Function isAuthenticated has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              isAuthenticated(): boolean {
                const token = this.SatellizerStorage.get(this.prefixedTokenName);
            
                if (token) {  // Token is present
                  if (token.split('.').length === 3) {  // Token with a valid JWT format XXX.YYY.ZZZ
            Severity: Minor
            Found in src/shared.ts - About 55 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 LoginWithFacebook has 9 return statements (exceeds 4 allowed).
            Open

            func LoginWithFacebook(w http.ResponseWriter, r *http.Request) {
                apiUrl := "https://graph.facebook.com"
                accessTokenPath := "/v2.3/oauth/access_token"
                graphApiPath := "/v2.3/me"
            
            
            Severity: Major
            Found in examples/server/go/oauth2.go - About 55 mins to fix

              Function setToken has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                setToken(response): void {
                  const tokenRoot = this.SatellizerConfig.tokenRoot;
                  const tokenName = this.SatellizerConfig.tokenName;
                  const accessToken = response && response.access_token;
              
              
              Severity: Minor
              Found in src/shared.ts - About 55 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

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

              angular.module('MyApp')
                .controller('NavbarCtrl', function($scope, $auth) {
                  $scope.isAuthenticated = function() {
                    return $auth.isAuthenticated();
                  };
              Severity: Minor
              Found in examples/server/php/public/controllers/navbar.js and 1 other location - About 55 mins to fix
              examples/client/controllers/navbar.js on lines 1..6

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

              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

              angular.module('MyApp')
                .controller('NavbarCtrl', function($scope, $auth) {
                  $scope.isAuthenticated = function() {
                    return $auth.isAuthenticated();
                  };
              Severity: Minor
              Found in examples/client/controllers/navbar.js and 1 other location - About 55 mins to fix
              examples/server/php/public/controllers/navbar.js on lines 1..6

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

              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 OAuth2 has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      function OAuth2($http, $window, $timeout, $q, SatellizerConfig, SatellizerPopup, SatellizerStorage) {
              Severity: Major
              Found in examples/ionic/www/lib/satellizer/dist/satellizer.js - About 50 mins to fix

                Function updatePositions has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  self.updatePositions = function(titleEle, updateTitleLeft, updateTitleRight, buttonsLeft, buttonsRight, updateCss, showPreviousTitle) {
                Severity: Major
                Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language