arikalfus/Jeeves

View on GitHub

Showing 108 of 108 total issues

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

        if($scope.regXloopForNews(sectionName, 'news')){
            $scope.$apply(function(){
                $scope.jeeves.newsPosition.section='news';
                $scope.jeeves.newsPosition.articleIndex = 0;
                $scope.status.isNewsOpen=true;
Severity: Major
Found in js/mvc.js and 5 other locations - About 5 hrs to fix
js/mvc.js on lines 744..805
js/mvc.js on lines 755..805
js/mvc.js on lines 766..805
js/mvc.js on lines 777..805
js/mvc.js on lines 788..805

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

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

        }else if($scope.regXloopForNews(sectionName, 'world')){
            $scope.$apply(function(){
                $scope.jeeves.newsPosition.section='world';
                $scope.jeeves.newsPosition.articleIndex = 0;
                $scope.status.isWorldOpen=true;
Severity: Major
Found in js/mvc.js and 5 other locations - About 5 hrs to fix
js/mvc.js on lines 733..805
js/mvc.js on lines 755..805
js/mvc.js on lines 766..805
js/mvc.js on lines 777..805
js/mvc.js on lines 788..805

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

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

      function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {

    /**
     * @ngdoc service
     * @name $route
Severity: Major
Found in js/angular-route.js - About 4 hrs to fix

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

            }else if ($scope.jeeves.view == 'news') {
                $scope.jeeves.newsmodalhelp = $modal.open({
                    templateUrl: "news-help.html",
                    windowClass: "help-window"
                })
    Severity: Major
    Found in js/mvc.js and 2 other locations - About 4 hrs to fix
    js/mvc.js on lines 583..640
    js/mvc.js on lines 595..640

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

    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

            if ($scope.jeeves.view == 'weather') {
                $scope.jeeves.weathermodalhelp = $modal.open({
                    templateUrl: "weather-help.html",
                    windowClass: 'help-window'
                })
    Severity: Major
    Found in js/mvc.js and 2 other locations - About 4 hrs to fix
    js/mvc.js on lines 595..640
    js/mvc.js on lines 607..640

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

    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

            }else if ($scope.jeeves.view == 'email') {
                $scope.jeeves.emailmodalhelp = $modal.open({
                    templateUrl: "email-help.html",
                    windowClass: "help-window"
                })
    Severity: Major
    Found in js/mvc.js and 2 other locations - About 4 hrs to fix
    js/mvc.js on lines 583..640
    js/mvc.js on lines 607..640

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

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

        $scope.changeNewsHelper=function(sectionName){
            if($scope.regXloopForNews(sectionName, 'news')){
                $scope.$apply(function(){
                    $scope.jeeves.newsPosition.section='news';
                    $scope.jeeves.newsPosition.articleIndex = 0;
    Severity: Major
    Found in js/mvc.js - About 2 hrs to fix

      Function readArticle has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $scope.readArticle = function(){
              $scope.jeeves.newsPosition.pause=false;
              $scope.jeeves.newsPosition.pausePosition=0;
              $scope.jeeves.newsPosition.contArticleContent="";
      
      
      Severity: Major
      Found in js/mvc.js - About 2 hrs to fix

        Function updateRoute has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function updateRoute() {
              var next = parseRoute(),
                  last = $route.current;
        
              if (next && last && next.$$route === last.$$route
        Severity: Major
        Found in js/angular-route.js - About 2 hrs to fix

          File angular-route.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * @license AngularJS v1.2.18
           * (c) 2010-2014 Google, Inc. http://angularjs.org
           * License: MIT
           */
          Severity: Minor
          Found in js/angular-route.js - About 2 hrs to fix

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

                    if ($scope.jeeves.newsPosition.section == "news"){
                        navigator.tts.speak($scope.jeeves.newsArticles.news[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }else if ($scope.jeeves.newsPosition.section == "world"){
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 934..954
            js/mvc.js on lines 938..954
            js/mvc.js on lines 942..954
            js/mvc.js on lines 946..954
            js/mvc.js on lines 950..954

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

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

                    }else if ($scope.jeeves.newsPosition.section == "sports"){
                        navigator.tts.speak($scope.jeeves.newsArticles.sports[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }else if ($scope.jeeves.newsPosition.section == "business"){
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 930..954
            js/mvc.js on lines 934..954
            js/mvc.js on lines 942..954
            js/mvc.js on lines 946..954
            js/mvc.js on lines 950..954

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

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

                    }else if ($scope.jeeves.newsPosition.section == "business"){
                        navigator.tts.speak($scope.jeeves.newsArticles.business[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }else if ($scope.jeeves.newsPosition.section == "technology"){
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 930..954
            js/mvc.js on lines 934..954
            js/mvc.js on lines 938..954
            js/mvc.js on lines 946..954
            js/mvc.js on lines 950..954

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

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

                    }else if ($scope.jeeves.newsPosition.section == "science"){
                        navigator.tts.speak($scope.jeeves.newsArticles.science[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 930..954
            js/mvc.js on lines 934..954
            js/mvc.js on lines 938..954
            js/mvc.js on lines 942..954
            js/mvc.js on lines 946..954

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

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

                    }else if ($scope.jeeves.newsPosition.section == "world"){
                        navigator.tts.speak($scope.jeeves.newsArticles.world[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }else if ($scope.jeeves.newsPosition.section == "sports"){
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 930..954
            js/mvc.js on lines 938..954
            js/mvc.js on lines 942..954
            js/mvc.js on lines 946..954
            js/mvc.js on lines 950..954

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

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

                    }else if ($scope.jeeves.newsPosition.section == "technology"){
                        navigator.tts.speak($scope.jeeves.newsArticles.tech[$scope.jeeves.newsPosition.articleIndex].webTitle+ $scope.jeeves.webTitle.calledWebTitle, function() {
                            $scope.reco($scope.dialogMan);
                        });
                    }else if ($scope.jeeves.newsPosition.section == "science"){
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 2 hrs to fix
            js/mvc.js on lines 930..954
            js/mvc.js on lines 934..954
            js/mvc.js on lines 938..954
            js/mvc.js on lines 942..954
            js/mvc.js on lines 950..954

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

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

                $scope.getHelp = function(results) {
                    if ($scope.jeeves.view == 'weather') {
                        $scope.jeeves.weathermodalhelp = $modal.open({
                            templateUrl: "weather-help.html",
                            windowClass: 'help-window'
            Severity: Major
            Found in js/mvc.js - About 2 hrs to fix

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

                      if($scope.jeeves.displayNews.newsCount<5){
                          var button = document.getElementById('newsBack');
                          button.disabled = 'disabled';
                      }else{
                          var button = document.getElementById('newsBack');
              Severity: Major
              Found in js/mvc.js and 5 other locations - About 2 hrs to fix
              js/mvc.js on lines 1181..1187
              js/mvc.js on lines 1188..1194
              js/mvc.js on lines 1195..1201
              js/mvc.js on lines 1202..1208
              js/mvc.js on lines 1209..1215

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

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

                      if($scope.jeeves.displayNews.worldCount<5){
                          var button = document.getElementById('worldBack');
                          button.disabled = 'disabled';
                      }else{
                          var button = document.getElementById('worldBack');
              Severity: Major
              Found in js/mvc.js and 5 other locations - About 2 hrs to fix
              js/mvc.js on lines 1174..1180
              js/mvc.js on lines 1188..1194
              js/mvc.js on lines 1195..1201
              js/mvc.js on lines 1202..1208
              js/mvc.js on lines 1209..1215

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

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

                      if($scope.jeeves.displayNews.techCount<5){
                          var button = document.getElementById('techBack');
                          button.disabled = 'disabled';
                      }else{
                          var button = document.getElementById('techBack');
              Severity: Major
              Found in js/mvc.js and 5 other locations - About 2 hrs to fix
              js/mvc.js on lines 1174..1180
              js/mvc.js on lines 1181..1187
              js/mvc.js on lines 1188..1194
              js/mvc.js on lines 1195..1201
              js/mvc.js on lines 1209..1215

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

              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