arikalfus/Jeeves

View on GitHub

Showing 108 of 108 total issues

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

    Function encode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    base64.encode = function(s) {
        if (arguments.length != 1) {
        throw "SyntaxError: Not enough arguments";
        }
        var padchar = base64.PADCHAR;
    Severity: Minor
    Found in js/base64.js - About 1 hr to fix

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

                  } else if (results[i].match(/go to/) || results[i].match(/goto/) || results[i].match(/open/) || results[i].match(/go back/) || results[i].match(/take/)) {
      Severity: Major
      Found in js/mvc.js and 1 other location - About 1 hr to fix
      js/mvc.js on lines 351..351

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

      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

                  } else if (results[i].match(/done/) || results[i].match(/go away/) || results[i].match(/that's all/) || results[i].match(/no/)) {
      Severity: Major
      Found in js/mvc.js and 1 other location - About 1 hr to fix
      js/mvc.js on lines 343..343

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

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

          $scope.changeWeather = function(setting) {
      
              var city = "";
      
              if(typeof setting == "boolean"){    // If the change is made by typing, the setting will be a boolean.
      Severity: Minor
      Found in js/mvc.js - About 1 hr to fix

        Function startTTS has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function startTTS() {
                navigator.tts.startup(success, fail);
        
                function success () {
                    var $element = $('#body-controller-element');
        Severity: Minor
        Found in js/startFunction.js - About 1 hr to fix

          Function changeView has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $scope.changeView = function(selected) {
                  if (selected == 'back'){
                      if ($scope.jeeves.isMenuOpen) {        // If the menu is open, the back button will just close the menu.
                          $scope.closeMenu();
                      } else {
          Severity: Minor
          Found in js/mvc.js - About 1 hr to fix

            Function newsSpeech has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $scope.newsSpeech = function(results){
                    // Should only go to news page if it match anything from here.
                    // ########Potential problem here: even though it is not "read something about news", it will still change the view to news.
                    if ($scope.jeeves.view != 'news') {
                        $scope.$apply(function(){
            Severity: Minor
            Found in js/mvc.js - About 1 hr to fix

              Function base64_decode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function base64_decode(data) {
                //  discuss at: http://phpjs.org/functions/base64_decode/
                // original by: Tyler Akins (http://rumkin.com)
                // improved by: Thunder.m
                // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
              Severity: Minor
              Found in js/base64_decode.js - About 1 hr to fix

                Function globalCommands has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $scope.globalCommands = function(results) {
                        for (var i = 0; i < results.length; i++){
                            if (results[i] == "how is the weather" || results[i] == "how's the weather" || results[i] == "what's the weather" || results[i] == "what is the weather like today" || results[i] == "what's the weather like" || results[i] == "how's the weather today" || results[i] == "how is the weather today"){
                                $scope.$apply(function() {
                                    $scope.changeView("weather");
                Severity: Minor
                Found in js/mvc.js - About 1 hr to fix

                  Function sayWebTitle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $scope.sayWebTitle = function(section){
                          $scope.adaptivePrompt();
                          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);
                  Severity: Minor
                  Found in js/mvc.js - About 1 hr to fix

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

                            }else if ($scope.jeeves.view == 'about') {
                                navigator.tts.speak("Nothing to do on this page! Let me open up the menu for you.", function() {
                                    $scope.$apply(function() {
                                        $scope.changeView('menu');
                                    })
                    Severity: Major
                    Found in js/mvc.js and 1 other location - About 1 hr to fix
                    js/mvc.js on lines 633..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 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

                    Consider simplifying this complex logical expression.
                    Open

                                if (results[i] == "how is the weather" || results[i] == "how's the weather" || results[i] == "what's the weather" || results[i] == "what is the weather like today" || results[i] == "what's the weather like" || results[i] == "how's the weather today" || results[i] == "how is the weather today"){
                                    $scope.$apply(function() {
                                        $scope.changeView("weather");
                                    })
                                    navigator.tts.speak("The current temperature in " + $scope.jeeves.city + " is " + Math.round($scope.jeeves.weather.temp.current) + " degrees fahrenheit. " + $scope.jeeves.weather.description + ".", function() {
                    Severity: Major
                    Found in js/mvc.js - About 1 hr to fix

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

                            function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {
                      Severity: Major
                      Found in js/angular-route.js - About 1 hr to fix

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

                                }else if ($scope.jeeves.view == 'contact') {
                                    navigator.tts.speak("Nothing to do on this page! Let me open up the menu for you.", function() {
                                        $scope.$apply(function() {
                                            $scope.changeView('menu');
                                        })
                        Severity: Major
                        Found in js/mvc.js and 1 other location - About 1 hr to fix
                        js/mvc.js on lines 619..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 55.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                        if ($scope.jeeves.view == 'email') {
                                            $timeout(function() {
                                                navigator.tts.speak("Would you like me to read your email?", function() {
                                                    $scope.reco($scope.confirmReadEmail);
                                                })
                        Severity: Minor
                        Found in js/mvc.js and 1 other location - About 55 mins to fix
                        js/mvc.js on lines 419..425

                        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

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

                                            if (OAuth.create("google_mail")) {
                                                $timeout(function() {
                                                    navigator.tts.speak("What next?", function() {
                                                        $scope.reco($scope.dialogMan);
                                                    })
                        Severity: Minor
                        Found in js/mvc.js and 1 other location - About 55 mins to fix
                        js/mvc.js on lines 1236..1246

                        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

                        Avoid deeply nested control flow statements.
                        Open

                                        if (angular.isFunction(templateUrl)) {
                                          templateUrl = templateUrl(next.params);
                                        }
                        Severity: Major
                        Found in js/angular-route.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (angular.isDefined(templateUrl)) {
                                            next.loadedTemplateUrl = templateUrl;
                                            template = $http.get(templateUrl, {cache: $templateCache}).
                                                then(function(response) { return response.data; });
                                          }
                          Severity: Major
                          Found in js/angular-route.js - About 45 mins to fix

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

                                          if (item.name == "From") {
                                            sender.setAttribute('id', 'email-sender');
                                            sender.innerHTML = '<b>From: ' + item.value + '</b><br>';
                                          }
                            Severity: Minor
                            Found in js/googleauthorize.js and 1 other location - About 45 mins to fix
                            js/googleauthorize.js on lines 66..69

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

                            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