arikalfus/Jeeves

View on GitHub

Showing 108 of 108 total issues

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

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

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

            }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 == "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 == "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 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 == "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

    Function $RouteProvider has 185 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function $RouteProvider(){
      function inherit(parent, extra) {
        return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra);
      }
    
    
    Severity: Major
    Found in js/angular-route.js - About 7 hrs to fix

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

      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

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

        Severity
        Category
        Status
        Source
        Language