sahat/satellizer

View on GitHub

Showing 562 of 562 total issues

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

angular.module('MyApp')
  .controller('HomeCtrl', function($scope, $http) {
    $http.jsonp('https://api.github.com/repos/sahat/satellizer?callback=JSON_CALLBACK')
      .success(function(data) {
        if (data) {
Severity: Major
Found in examples/client/controllers/home.js and 1 other location - About 6 hrs to fix
examples/server/php/public/controllers/home.js on lines 1..17

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

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('HomeCtrl', function($scope, $http) {
    $http.jsonp('https://api.github.com/repos/sahat/satellizer?callback=JSON_CALLBACK')
      .success(function(data) {
        if (data) {
Severity: Major
Found in examples/server/php/public/controllers/home.js and 1 other location - About 6 hrs to fix
examples/client/controllers/home.js on lines 1..17

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

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

    var Config = (function () {
        function Config() {
            this.baseUrl = '/';
            this.loginUrl = '/auth/login';
            this.signupUrl = '/auth/signup';
Severity: Major
Found in examples/ionic/www/lib/satellizer/dist/satellizer.js - About 6 hrs to fix

    Function animationRunner has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function animationRunner(element, animationEvent, className, options) {
            //transcluded directives may sometimes fire an animation using only comment nodes
            //best to catch this early on to prevent any animation operations from occurring
            var node = element[0];
            if (!node) {
    Severity: Major
    Found in examples/ionic/www/lib/ionic/js/angular/angular-animate.js - About 5 hrs to fix

      Function $UrlRouterProvider has 143 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function $UrlRouterProvider(   $locationProvider,   $urlMatcherFactory) {
        var rules = [], otherwise = null, interceptDeferred = false, listener;
      
        // Returns a string that is a prefix of all strings matching the RegExp
        function regExpPrefix(re) {
      Severity: Major
      Found in examples/ionic/www/lib/ionic/js/angular-ui/angular-ui-router.js - About 5 hrs to fix

        Function AuthProvider has 143 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var AuthProvider = (function () {
                function AuthProvider(SatellizerConfig) {
                    this.SatellizerConfig = SatellizerConfig;
                }
                Object.defineProperty(AuthProvider.prototype, "baseUrl", {
        Severity: Major
        Found in examples/ionic/www/lib/satellizer/dist/satellizer.js - About 5 hrs to fix

          Function Config has 141 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function Config() {
                      this.baseUrl = '/';
                      this.loginUrl = '/auth/login';
                      this.signupUrl = '/auth/signup';
                      this.unlinkUrl = '/auth/unlink/';
          Severity: Major
          Found in examples/ionic/www/lib/satellizer/dist/satellizer.js - About 5 hrs to fix

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

                      $scope.$watch(function() {
                        return listCtrl.showDelete();
                      }, function(isShown, wasShown) {
                        //Only use isShown=false if it was already shown
                        if (!isShown && !wasShown) { return; }
            Severity: Major
            Found in examples/ionic/www/lib/ionic/js/ionic-angular.js and 1 other location - About 5 hrs to fix
            examples/ionic/www/lib/ionic/js/ionic-angular.js on lines 10749..10763

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

            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

                      $scope.$watch(function() {
                        return listCtrl.showReorder();
                      }, function(isShown, wasShown) {
                        //Only use isShown=false if it was already shown
                        if (!isShown && !wasShown) { return; }
            Severity: Major
            Found in examples/ionic/www/lib/ionic/js/ionic-angular.js and 1 other location - About 5 hrs to fix
            examples/ionic/www/lib/ionic/js/ionic-angular.js on lines 10733..10747

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

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

                compile: function(element, attr) {
                  element.addClass('menu-content pane');
            
                  return { pre: prelink };
                  function prelink($scope, $element, $attr, sideMenuCtrl) {
            Severity: Major
            Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 5 hrs to fix

              Function resourceFactory has 133 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function resourceFactory(url, paramDefaults, actions, options) {
                      var route = new Route(url, options);
              
                      actions = extend({}, provider.defaults.actions, actions);
              
              
              Severity: Major
              Found in examples/ionic/www/lib/ionic/js/angular/angular-resource.js - About 5 hrs to fix

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

                angular.module('MyApp')
                  .controller('SignupCtrl', function($scope, $location, $auth, toastr) {
                    $scope.signup = function() {
                      $auth.signup($scope.user)
                        .then(function(response) {
                Severity: Major
                Found in examples/client/controllers/signup.js and 1 other location - About 5 hrs to fix
                examples/server/php/public/controllers/signup.js on lines 1..14

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

                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('SignupCtrl', function($scope, $location, $auth, toastr) {
                    $scope.signup = function() {
                      $auth.signup($scope.user)
                        .then(function(response) {
                Severity: Major
                Found in examples/server/php/public/controllers/signup.js and 1 other location - About 5 hrs to fix
                examples/client/controllers/signup.js on lines 1..14

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

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

                      function prelink($scope, $element, $attr, sideMenuCtrl) {
                        var startCoord = null;
                        var primaryScrollAxis = null;
                
                        if (isDefined(attr.dragContent)) {
                Severity: Major
                Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 5 hrs to fix

                  AuthProvider has 39 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export default class AuthProvider {
                    static $inject = ['SatellizerConfig'];
                  
                    constructor(private SatellizerConfig: Config) {}
                  
                  
                  Severity: Minor
                  Found in src/authProvider.ts - About 5 hrs to fix

                    Function $Resolve has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function $Resolve(  $q,    $injector) {
                      
                      var VISIT_IN_PROGRESS = 1,
                          VISIT_DONE = 2,
                          NOTHING = {},
                    Severity: Major
                    Found in examples/ionic/www/lib/ionic/js/angular-ui/angular-ui-router.js - About 4 hrs to fix

                      Function DynamicViewType has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function DynamicViewType() {
                            var self = this;
                            var debouncedScrollViewSetDimensions = ionic.debounce(scrollViewSetDimensions, 25, true);
                            var calculateDimensions = isGridView ? calculateDimensionsGrid : calculateDimensionsList;
                            var dimensionsIndex;
                      Severity: Major
                      Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 4 hrs to fix

                        Function createHeaderBar has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          self.createHeaderBar = function(isActive) {
                            var containerEle = jqLite('<div class="nav-bar-block">');
                            ionic.DomUtil.cachedAttr(containerEle, 'nav-bar', isActive ? 'active' : 'cached');
                        
                            var alignTitle = $attrs.alignTitle || $ionicConfig.navBar.alignTitle();
                        Severity: Major
                        Found in examples/ionic/www/lib/ionic/js/ionic-angular.js - About 4 hrs to fix

                          Function LoginWithTwitter has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func LoginWithTwitter(w http.ResponseWriter, r *http.Request) {
                          
                              c := oauth.NewConsumer(
                                  config.TWITTER_KEY,
                                  config.TWITTER_SECRET,
                          Severity: Minor
                          Found in examples/server/go/oauth.go - About 4 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

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

                                forEach({
                                  'name': attr.name,
                                  'ng-value': attr.ngValue,
                                  'ng-model': attr.ngModel,
                                  'ng-checked': attr.ngChecked,
                          Severity: Major
                          Found in examples/ionic/www/lib/ionic/js/ionic-angular.js and 1 other location - About 4 hrs to fix
                          examples/ionic/www/lib/ionic/js/ionic-angular.js on lines 8327..8342

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

                          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