arikalfus/Jeeves

View on GitHub

Showing 108 of 108 total issues

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

        if($scope.jeeves.displayNews.businessCount<5){
            var button = document.getElementById('businessBack');
            button.disabled = 'disabled';
        }else{
            var button = document.getElementById('businessBack');
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 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

Function ngViewFactory has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ngViewFactory(   $route,   $anchorScroll,   $animate) {
  return {
    restrict: 'ECA',
    terminal: true,
    priority: 400,
Severity: Major
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.displayNews.sportsCount<5){
                var button = document.getElementById('sportsBack');
                button.disabled = 'disabled';
            }else{
                var button = document.getElementById('sportsBack');
    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 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.scienceCount<5){
                var button = document.getElementById('scienceBack');
                button.disabled = 'disabled';
            }else{
                var button = document.getElementById('scienceBack');
    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 1202..1208

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

        $scope.confirmReadEmail = function(results) {
            if (!$scope.confirmSpeech(results, ['read email'])) {
                navigator.tts.speak("Ok. So what next?", function() {
                    $scope.reco($scope.dialogMan);
                })
    Severity: Major
    Found in js/mvc.js and 1 other location - About 2 hrs to fix
    js/mvc.js on lines 1122..1128

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

    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.confirmReadWeather = function(results) {
            if (!$scope.confirmSpeech(results, ["how's the weather"])) {
                navigator.tts.speak("OK. So what next?", function() {
                    $scope.reco($scope.dialogMan);
                })
    Severity: Major
    Found in js/mvc.js and 1 other location - About 2 hrs to fix
    js/mvc.js on lines 1103..1109

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

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

    function makeApiCall() {
      gapi.client.load('gmail', 'v1', function() {
        var request = gapi.client.gmail.users.messages.list({
          labelIds: ['INBOX', 'UNREAD']
        });
    Severity: Minor
    Found in js/googleauthorize.js - About 2 hrs to fix

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

              try {
                  var $element = $('#body-controller-element');
                  var scope = angular.element($element).scope();
                  scope.$apply(function() {
                      scope.changeView('back');
      Severity: Major
      Found in js/startFunction.js and 1 other location - About 1 hr to fix
      js/startFunction.js on lines 55..61

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

      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

              try {
                  var $element = $('#body-controller-element');
                  var scope = angular.element($element).scope();
                  scope.$apply(function() {
                      scope.changeView('menu');    
      Severity: Major
      Found in js/startFunction.js and 1 other location - About 1 hr to fix
      js/startFunction.js on lines 43..49

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

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

          link: function(scope, $element, attr, ctrl, $transclude) {
              var currentScope,
                  currentElement,
                  previousElement,
                  autoScrollExp = attr.autoscroll,
      Severity: Minor
      Found in js/angular-route.js - About 1 hr to fix

        Function getEmail has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $scope.getEmail = function() {
                $scope.jeeves.emailList.length = 0;
                $scope.jeeves.emailCount = 0;
                // After get the email, hide the refiresh button.
                document.getElementById("refresh-button").style.visibility = "hidden";
        Severity: Minor
        Found in js/mvc.js - About 1 hr to fix

          Function disableBack has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $scope.disableBack = function(){
                  if($scope.jeeves.displayNews.newsCount<5){
                      var button = document.getElementById('newsBack');
                      button.disabled = 'disabled';
                  }else{
          Severity: Minor
          Found in js/mvc.js - About 1 hr to fix

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

                    $scope.jeeves.displayNews.news = $scope.jeeves.newsArticles.news.slice($scope.jeeves.displayNews.newsCount, $scope.jeeves.displayNews.newsCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1221..1221
            js/mvc.js on lines 1222..1222
            js/mvc.js on lines 1223..1223
            js/mvc.js on lines 1224..1224
            js/mvc.js on lines 1225..1225

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

            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

                    $scope.jeeves.displayNews.world = $scope.jeeves.newsArticles.world.slice($scope.jeeves.displayNews.worldCount, $scope.jeeves.displayNews.worldCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1220..1220
            js/mvc.js on lines 1222..1222
            js/mvc.js on lines 1223..1223
            js/mvc.js on lines 1224..1224
            js/mvc.js on lines 1225..1225

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

            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

                    $scope.jeeves.displayNews.tech = $scope.jeeves.newsArticles.tech.slice($scope.jeeves.displayNews.techCount, $scope.jeeves.displayNews.techCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1220..1220
            js/mvc.js on lines 1221..1221
            js/mvc.js on lines 1222..1222
            js/mvc.js on lines 1223..1223
            js/mvc.js on lines 1225..1225

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

            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

                    $scope.jeeves.displayNews.sports = $scope.jeeves.newsArticles.sports.slice($scope.jeeves.displayNews.sportsCount, $scope.jeeves.displayNews.sportsCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1220..1220
            js/mvc.js on lines 1221..1221
            js/mvc.js on lines 1223..1223
            js/mvc.js on lines 1224..1224
            js/mvc.js on lines 1225..1225

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

            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

                    $scope.jeeves.displayNews.science = $scope.jeeves.newsArticles.science.slice($scope.jeeves.displayNews.scienceCount, $scope.jeeves.displayNews.scienceCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1220..1220
            js/mvc.js on lines 1221..1221
            js/mvc.js on lines 1222..1222
            js/mvc.js on lines 1223..1223
            js/mvc.js on lines 1224..1224

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

            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

                    $scope.jeeves.displayNews.business = $scope.jeeves.newsArticles.business.slice($scope.jeeves.displayNews.businessCount, $scope.jeeves.displayNews.businessCount+5);
            Severity: Major
            Found in js/mvc.js and 5 other locations - About 1 hr to fix
            js/mvc.js on lines 1220..1220
            js/mvc.js on lines 1221..1221
            js/mvc.js on lines 1222..1222
            js/mvc.js on lines 1224..1224
            js/mvc.js on lines 1225..1225

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

            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 ($scope.regXloop(results, 'yes') || $scope.regXloop(results, 'yeah') || $scope.regXloop(results, 'yup') || $scope.regXloop(results, 'sure') || $scope.regXloop(results, 'ok')) {
                        $scope.dialogMan(command); // Command must be an array.
                        return true;
                    }
            Severity: Major
            Found in js/mvc.js and 1 other location - About 1 hr to fix
            js/mvc.js on lines 839..845

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

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

            base64.decode = function(s) {
                // convert to string
                s = "" + s;
                var getbyte64 = base64.getbyte64;
                var pads, i, b10;
            Severity: Minor
            Found in js/base64.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language