arikalfus/Jeeves

View on GitHub
js/mvc.js

Summary

Maintainability
F
1 mo
Test Coverage

File mvc.js has 1163 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//Authors: Ari Kalfus, Burak Sezer, Sam Raphael, Wesley Wei Qian

var model = {
    name: "Jeeves",
    view: "weather",
Severity: Major
Found in js/mvc.js - About 2 days to fix

    Function goToSpeech has 147 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $scope.goToSpeech = function(results) {
            if ($scope.regXloop(results, 'news')) {
                if ($scope.jeeves.view != 'news') {
                    navigator.tts.speak("On it.", function() {
                        $scope.$apply(function() {
    Severity: Major
    Found in js/mvc.js - About 5 hrs to fix

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

            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

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

                          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

                            Avoid deeply nested control flow statements.
                            Open

                                    } else if ($scope.regXloop(results, 'settings')) {
                                        if ($scope.jeeves.view != 'settings') {
                                            navigator.tts.speak("On it.", function() {
                                                $scope.$apply(function() {
                                                    $scope.changeView('settings');
                            Severity: Major
                            Found in js/mvc.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                          if ($scope.jeeves.view != 'menu') {
                                              navigator.tts.speak("On it.", function() {
                                                  $scope.$apply(function() {
                                                      $scope.changeView('menu');
                                                  });
                              Severity: Major
                              Found in js/mvc.js - About 45 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if ($scope.regXloopForNews(results, 'news')||$scope.regXloopForNews(results, 'world')||$scope.regXloopForNews(results, 'sports')||$scope.regXloopForNews(results, 'business')||$scope.regXloopForNews(results, 'tech')||$scope.regXloopForNews(results, 'science')){
                                                $scope.changeNewsHelper(results);
                                                return true;
                                            }
                                Severity: Major
                                Found in js/mvc.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                  if ($scope.regXloopForNews(results1[i], 'news')||$scope.regXloopForNews(results1[i], 'world')||$scope.regXloopForNews(results1[i], 'sports')||$scope.regXloopForNews(results1[i], 'business')||$scope.regXloopForNews(results1[i], 'tech')||$scope.regXloopForNews(results1[i], 'science')){
                                                      if($scope.changeNewsSection(results1[i])){
                                                          $scope.sayWebTitle($scope.jeeves.newsPosition.section);
                                                          return true;
                                                      }
                                  Severity: Major
                                  Found in js/mvc.js - About 40 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return true;
                                    Severity: Major
                                    Found in js/mvc.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  return true;
                                      Severity: Major
                                      Found in js/mvc.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return $scope.changeNewsSection(results[i]);
                                        Severity: Major
                                        Found in js/mvc.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return false;
                                          Severity: Major
                                          Found in js/mvc.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                        return true;
                                            Severity: Major
                                            Found in js/mvc.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                          return true;
                                              Severity: Major
                                              Found in js/mvc.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return false;
                                                Severity: Major
                                                Found in js/mvc.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return true;
                                                  Severity: Major
                                                  Found in js/mvc.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                return true;
                                                    Severity: Major
                                                    Found in js/mvc.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return true;
                                                      Severity: Major
                                                      Found in js/mvc.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                    return true;
                                                        Severity: Major
                                                        Found in js/mvc.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                          return $scope.refreshEmail();
                                                          Severity: Major
                                                          Found in js/mvc.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                        return true;
                                                            Severity: Major
                                                            Found in js/mvc.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                          return true;
                                                              Severity: Major
                                                              Found in js/mvc.js - About 30 mins to fix

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

                                                                    $http.get('http://beta.content.guardianapis.com/search?section=business&page-size=99&show-fields=body&date-id=date%2Flast24hours&api-key=mfqem2e9vt7hjhww88ce99vr').success(function(data){
                                                                        var count=0;
                                                                        for(var i=0;i<200;i++){
                                                                            if(data.response.results[i]!=undefined){
                                                                                if(data.response.results[i].hasOwnProperty('fields')){
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 85..100
                                                                js/mvc.js on lines 101..116
                                                                js/mvc.js on lines 133..148
                                                                js/mvc.js on lines 149..164

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

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

                                                                    $http.get('http://beta.content.guardianapis.com/search?section=world&page-size=99&show-fields=body&date-id=date%2Flast24hours&api-key=mfqem2e9vt7hjhww88ce99vr').success(function(data){
                                                                        var count=0;
                                                                        for(var i=0;i<200;i++){
                                                                            if(data.response.results[i]!=undefined){
                                                                                if(data.response.results[i].hasOwnProperty('fields')){
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 101..116
                                                                js/mvc.js on lines 117..132
                                                                js/mvc.js on lines 133..148
                                                                js/mvc.js on lines 149..164

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

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

                                                                    $http.get('http://beta.content.guardianapis.com/search?section=science&page-size=99&show-fields=body&date-id=date%2Flast24hours&api-key=mfqem2e9vt7hjhww88ce99vr').success(function(data){
                                                                        var count=0;
                                                                        for(var i=0;i<200;i++){
                                                                                if(data.response.results[i]!=undefined){
                                                                                if(data.response.results[i].hasOwnProperty('fields')){
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 85..100
                                                                js/mvc.js on lines 101..116
                                                                js/mvc.js on lines 117..132
                                                                js/mvc.js on lines 133..148

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

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

                                                                    $http.get('http://beta.content.guardianapis.com/search?section=technology&page-size=99&show-fields=body&date-id=date%2Flast24hours&api-key=mfqem2e9vt7hjhww88ce99vr').success(function(data){
                                                                        var count=0;
                                                                        for(var i=0;i<200;i++){
                                                                            if(data.response.results[i]!=undefined){
                                                                                if(data.response.results[i].hasOwnProperty('fields')){
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 85..100
                                                                js/mvc.js on lines 101..116
                                                                js/mvc.js on lines 117..132
                                                                js/mvc.js on lines 149..164

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

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

                                                                    $http.get('http://beta.content.guardianapis.com/search?section=sport&page-size=99&show-fields=body&date-id=date%2Flast24hours&api-key=mfqem2e9vt7hjhww88ce99vr').success(function(data){
                                                                        var count=0;
                                                                        for(var i=0;i<200;i++){
                                                                            if(data.response.results[i]!=undefined){
                                                                                if(data.response.results[i].hasOwnProperty('fields')){
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 85..100
                                                                js/mvc.js on lines 117..132
                                                                js/mvc.js on lines 133..148
                                                                js/mvc.js on lines 149..164

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

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

                                                                        }else if ($scope.jeeves.newsPosition.section == "world"){
                                                                            var gotResult = $scope.jeeves.newsArticles.world[$scope.jeeves.newsPosition.articleIndex].fields.body;
                                                                            div1=document.createElement('div');
                                                                            div1.innerHTML=gotResult;
                                                                            var finalResult=$(div1).text();
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 990..1034
                                                                js/mvc.js on lines 1001..1034
                                                                js/mvc.js on lines 1012..1034
                                                                js/mvc.js on lines 1023..1034

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

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

                                                                        }else if ($scope.jeeves.newsPosition.section == "sports"){
                                                                            var gotResult = $scope.jeeves.newsArticles.sports[$scope.jeeves.newsPosition.articleIndex].fields.body;
                                                                            div1=document.createElement('div');
                                                                            div1.innerHTML=gotResult;
                                                                            var finalResult=$(div1).text();
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 979..1034
                                                                js/mvc.js on lines 1001..1034
                                                                js/mvc.js on lines 1012..1034
                                                                js/mvc.js on lines 1023..1034

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

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

                                                                        }else if ($scope.jeeves.newsPosition.section == "tech"){
                                                                            var gotResult = $scope.jeeves.newsArticles.tech[$scope.jeeves.newsPosition.articleIndex].fields.body;
                                                                            div1=document.createElement('div');
                                                                            div1.innerHTML=gotResult;
                                                                            var finalResult=$(div1).text();
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 979..1034
                                                                js/mvc.js on lines 990..1034
                                                                js/mvc.js on lines 1001..1034
                                                                js/mvc.js on lines 1023..1034

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

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

                                                                        }else if ($scope.jeeves.newsPosition.section == "science"){
                                                                            var gotResult = $scope.jeeves.newsArticles.science[$scope.jeeves.newsPosition.articleIndex].fields.body;
                                                                            div1=document.createElement('div');
                                                                            div1.innerHTML=gotResult;
                                                                            var finalResult=$(div1).text();
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 979..1034
                                                                js/mvc.js on lines 990..1034
                                                                js/mvc.js on lines 1001..1034
                                                                js/mvc.js on lines 1012..1034

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

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

                                                                        }else if ($scope.jeeves.newsPosition.section == "business"){
                                                                            var gotResult = $scope.jeeves.newsArticles.business[$scope.jeeves.newsPosition.articleIndex].fields.body;
                                                                            div1=document.createElement('div');
                                                                            div1.innerHTML=gotResult;
                                                                            var finalResult=$(div1).text();
                                                                Severity: Major
                                                                Found in js/mvc.js and 4 other locations - About 1 day to fix
                                                                js/mvc.js on lines 979..1034
                                                                js/mvc.js on lines 990..1034
                                                                js/mvc.js on lines 1012..1034
                                                                js/mvc.js on lines 1023..1034

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

                                                                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.regXloop(results, 'settings')) {
                                                                            if ($scope.jeeves.view != 'settings') {
                                                                                navigator.tts.speak("On it.", function() {
                                                                                    $scope.$apply(function() {
                                                                                        $scope.changeView('settings');
                                                                Severity: Major
                                                                Found in js/mvc.js and 2 other locations - About 6 hrs to fix
                                                                js/mvc.js on lines 478..543
                                                                js/mvc.js on lines 496..543

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

                                                                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.regXloop(results, 'contact')) {
                                                                            if ($scope.jeeves.view != 'contact') {
                                                                                navigator.tts.speak("On it.", function() {
                                                                                    $scope.$apply(function() {
                                                                                        $scope.changeView('contact');
                                                                Severity: Major
                                                                Found in js/mvc.js and 2 other locations - About 6 hrs to fix
                                                                js/mvc.js on lines 460..543
                                                                js/mvc.js on lines 496..543

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

                                                                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.regXloop(results, 'about')) {
                                                                            if ($scope.jeeves.view != 'about') {
                                                                                navigator.tts.speak("On it.", function() {
                                                                                    $scope.$apply(function() {
                                                                                        $scope.changeView('about');
                                                                Severity: Major
                                                                Found in js/mvc.js and 2 other locations - About 6 hrs to fix
                                                                js/mvc.js on lines 460..543
                                                                js/mvc.js on lines 478..543

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

                                                                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, 'tech')){
                                                                            $scope.$apply(function(){
                                                                                $scope.jeeves.newsPosition.section='tech';
                                                                                $scope.jeeves.newsPosition.articleIndex = 0;
                                                                                $scope.status.isTechOpen=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 744..805
                                                                js/mvc.js on lines 755..805
                                                                js/mvc.js on lines 766..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, 'science')){
                                                                            $scope.$apply(function(){
                                                                                $scope.jeeves.newsPosition.section='science';
                                                                                $scope.jeeves.newsPosition.articleIndex = 0;
                                                                                $scope.status.isScienceOpen=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 744..805
                                                                js/mvc.js on lines 755..805
                                                                js/mvc.js on lines 766..805
                                                                js/mvc.js on lines 777..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, 'business')){
                                                                            $scope.$apply(function(){
                                                                                $scope.jeeves.newsPosition.section='business';
                                                                                $scope.jeeves.newsPosition.articleIndex = 0;
                                                                                $scope.status.isBusinessOpen=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 744..805
                                                                js/mvc.js on lines 755..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, 'sports')){
                                                                            $scope.$apply(function(){
                                                                                $scope.jeeves.newsPosition.section='sports';
                                                                                $scope.jeeves.newsPosition.articleIndex = 0;
                                                                                $scope.status.isSportsOpen=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 744..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

                                                                        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

                                                                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

                                                                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

                                                                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

                                                                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

                                                                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

                                                                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

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

                                                                        if($scope.regXloop(results, 'news')||$scope.regXloop(results, 'world')||$scope.regXloop(results, 'sports')||$scope.regXloop(results, 'tech')||$scope.regXloop(results, 'science')){
                                                                            $scope.readDiagNews(results);
                                                                        }
                                                                        else{
                                                                            $scope.dialogMan(results);    // If it does not match anything, take a reuslt again.
                                                                Severity: Major
                                                                Found in js/mvc.js and 1 other location - About 1 hr to fix
                                                                js/mvc.js on lines 645..648

                                                                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

                                                                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

                                                                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

                                                                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

                                                                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

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

                                                                            if($scope.regXloopForNews(results1[i], 'article')||$scope.regXloopForNews(results1[i], 'this')||$scope.regXloopForNews(results1[i], 'now')){
                                                                                $scope.readArticle();
                                                                                return true;
                                                                            }
                                                                            else{
                                                                Severity: Minor
                                                                Found in js/mvc.js and 1 other location - About 40 mins to fix
                                                                js/mvc.js on lines 702..716

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

                                                                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($scope.regXloopForNews(results[i], 'previous five')||$scope.regXloopForNews(results[i], 'previous articles')||$scope.regXloopForNews(results[i], 'previous news')){
                                                                                $scope.$apply(function(){
                                                                                    $scope.differentFive($scope.jeeves.newsPosition.section,false);
                                                                                });
                                                                                return true;
                                                                Severity: Minor
                                                                Found in js/mvc.js and 1 other location - About 40 mins to fix
                                                                js/mvc.js on lines 812..832

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

                                                                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($scope.regXloopForNews(results[i], 'more articles')){
                                                                                $scope.$apply(function(){
                                                                                    $scope.differentFive($scope.jeeves.newsPosition.section,true);
                                                                                });
                                                                                return true;
                                                                Severity: Minor
                                                                Found in js/mvc.js and 1 other location - About 35 mins to fix
                                                                js/mvc.js on lines 702..716

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

                                                                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

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status