jiskattema/spot

View on GitHub
src/app.js

Summary

Maintainability
F
1 wk
Test Coverage

File app.js has 589 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Spot = require('spot-framework');
var app = require('ampersand-app');
var Router = require('./router');
var MainView = require('./pages/main');
var DatasetsView = require('./pages/datasets');
Severity: Major
Found in src/app.js - About 1 day to fix

    `` has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    app.extend({
      /**
       * [fullscreenMode description]
       * @type {Boolean}
       */
    Severity: Minor
    Found in src/app.js - About 2 hrs to fix

      Function importCSV has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        importCSV: function () {
          // var fileLoader = this.queryByHook('csv-upload-input');
          var fileLoader = document.getElementById('csvuploadBtn');
          var uploadedFile = fileLoader.files[0];
          var reader = new window.FileReader();
      Severity: Major
      Found in src/app.js - About 2 hrs to fix

        Function zenodoRequest has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          zenodoRequest: async function(zenodoParams) {
        
            var url_addition = zenodoParams.url_addition;
            var requestType = zenodoParams.requestType;
            var bodyData = zenodoParams.bodyData;
        Severity: Major
        Found in src/app.js - About 2 hrs to fix

          Function importJSON has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            importJSON: function () {
              // var fileLoader = this.queryByHook('json-upload-input');
              var fileLoader = document.getElementById('jsonuploadBtn');
              var uploadedFile = fileLoader.files[0];
              var reader = new window.FileReader();
          Severity: Major
          Found in src/app.js - About 2 hrs to fix

            Function onload has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                reader.onload = function (ev) {
                  app.message({
                    text: 'Processing',
                    type: 'ok'
                  });
            Severity: Minor
            Found in src/app.js - About 1 hr to fix

              Function startHelp has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                startHelp: function () {
              
                  console.log(app.currentPage.helpTemplate);
                  console.log(app.currentPage.helpHints);
                  console.log(app.currentPage.helpSteps);
              Severity: Minor
              Found in src/app.js - About 1 hr to fix

                Function startWelcome has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  startWelcome: function () {
                    var welcome = Help();
                    welcome.setOption('tooltipClass', 'welcome-dialog');
                    welcome.setOptions({
                      'showStepNumbers': false,
                Severity: Minor
                Found in src/app.js - About 1 hr to fix

                  Function exportData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    exportData: function () {
                      var chartsData = [];
                  
                      var partitionRankToName = {1: 'a', 2: 'b', 3: 'c', 4: 'd'};
                      var aggregateRankToName = {1: 'aa', 2: 'bb', 3: 'cc', 4: 'dd', 5: 'ee'};
                  Severity: Minor
                  Found in src/app.js - About 1 hr to fix

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

                        reader.onload = function (ev) {
                          app.message({
                            text: 'Processing',
                            type: 'ok'
                          });
                    Severity: Minor
                    Found in src/app.js - About 1 hr to fix

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

                        importRemoteSession: function (sessionUrl) {
                          // console.log('app.js: Getting the remote session.');
                          var that = this;
                      
                          app.busy({enable: true});
                      Severity: Minor
                      Found in src/app.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                            if (navigator.userAgent.match(/Android/i) ||
                            navigator.userAgent.match(/webOS/i) ||
                            navigator.userAgent.match(/iPhone/i) ||
                            navigator.userAgent.match(/iPad/i) ||
                            navigator.userAgent.match(/iPod/i) ||
                        Severity: Major
                        Found in src/app.js - About 1 hr to fix

                          Function startHelp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                            startHelp: function () {
                          
                              console.log(app.currentPage.helpTemplate);
                              console.log(app.currentPage.helpHints);
                              console.log(app.currentPage.helpSteps);
                          Severity: Minor
                          Found in src/app.js - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function zenodoRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                            zenodoRequest: async function(zenodoParams) {
                          
                              var url_addition = zenodoParams.url_addition;
                              var requestType = zenodoParams.requestType;
                              var bodyData = zenodoParams.bodyData;
                          Severity: Minor
                          Found in src/app.js - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Consider simplifying this complex logical expression.
                          Open

                              if (
                                (!app.currentPage.helpTemplate || app.currentPage.helpTemplate === '') &&
                                (!app.currentPage.helpHints || app.currentPage.helpHints() === []) &&
                                (!app.currentPage.helpSteps || app.currentPage.helpTemplate === [])
                              ) {
                          Severity: Major
                          Found in src/app.js - About 40 mins to fix

                            Function importJSON has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              importJSON: function () {
                                // var fileLoader = this.queryByHook('json-upload-input');
                                var fileLoader = document.getElementById('jsonuploadBtn');
                                var uploadedFile = fileLoader.files[0];
                                var reader = new window.FileReader();
                            Severity: Minor
                            Found in src/app.js - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            TODO found
                            Open

                                // TODO: enforce spot.driver === 'client'
                            Severity: Minor
                            Found in src/app.js by fixme

                            TODO found
                            Open

                                // TODO: enforce spot.driver === 'client'
                            Severity: Minor
                            Found in src/app.js by fixme

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

                                      dataset.facets.forEach(function (facet, i) {
                                        if (i < 20) {
                                          facet.isActive = true;
                            
                                          if (facet.isCategorial) {
                            Severity: Major
                            Found in src/app.js and 1 other location - About 3 hrs to fix
                            src/app.js on lines 511..521

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

                            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

                                    dataset.facets.forEach(function (facet, i) {
                                      if (i < 20) {
                                        facet.isActive = true;
                            
                                        if (facet.isCategorial) {
                            Severity: Major
                            Found in src/app.js and 1 other location - About 3 hrs to fix
                            src/app.js on lines 603..613

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

                            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

                              addSessionToLocalStorage: function(session) {
                                console.log('Adding a session to the local storage');
                                console.log(session);
                                var allSessions = this.getSessionsFromLocalStorage();
                                // allDatasets.forEach(function(dset, index) {
                            Severity: Major
                            Found in src/app.js and 1 other location - About 2 hrs to fix
                            src/app.js on lines 325..334

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

                              addDatasetToLocalStorage: function(dataset) {
                                console.log('Adding a dataset to the local storage');
                                console.log(dataset);
                                var allDatasets = this.getDatasetsFromLocalStorage();
                                // allDatasets.forEach(function(dset, index) {
                            Severity: Major
                            Found in src/app.js and 1 other location - About 2 hrs to fix
                            src/app.js on lines 367..376

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

                                allDatasets.forEach(function(dset, index) {
                                  console.log("[" + index + "]: " + dset.id + '  ', dset.name);
                                  if ( dataset.id === dset.id )
                                    allDatasets.splice(index, 1);
                                });
                            Severity: Major
                            Found in src/app.js and 1 other location - About 2 hrs to fix
                            src/app.js on lines 385..389

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

                            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

                                allSessions.forEach(function(sess, index) {
                                  console.log("[" + index + "]: " + sess.id + '  ', sess.name);
                                  if ( input_session.id === sess.id )
                                    allSessions.splice(index, 1);
                                });
                            Severity: Major
                            Found in src/app.js and 1 other location - About 2 hrs to fix
                            src/app.js on lines 343..347

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

                            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

                                reader.onprogress = function (ev) {
                                  if (ev.lengthComputable) {
                                    // ev.loaded and ev.total are ProgressEvent properties
                                    app.progress(parseInt(100.0 * ev.loaded / ev.total));
                                  }
                            Severity: Major
                            Found in src/app.js and 1 other location - About 1 hr to fix
                            src/app.js on lines 638..643

                            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

                                reader.onprogress = function (ev) {
                                  if (ev.lengthComputable) {
                                    // ev.loaded and ev.total are ProgressEvent properties
                                    app.progress(parseInt(100.0 * ev.loaded / ev.total));
                                  }
                            Severity: Major
                            Found in src/app.js and 1 other location - About 1 hr to fix
                            src/app.js on lines 552..557

                            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

                                if (app.me.sessionType === 'client') {
                                  // for client datasets, also save the data in the session file
                                  app.me.datasets.forEach(function (dataset, i) {
                                    json.datasets[i].data = dataset.data;
                                  });
                            Severity: Major
                            Found in src/app.js and 1 other location - About 1 hr to fix
                            src/app.js on lines 650..655

                            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

                                if (app.me.sessionType === 'client') {
                                  // for client datasets, also save the data in the session file
                                  app.me.datasets.forEach(function (dataset, i) {
                                    json.datasets[i].data = dataset.data;
                                  });
                            Severity: Major
                            Found in src/app.js and 1 other location - About 1 hr to fix
                            src/app.js on lines 404..409

                            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

                              getDatasetsFromLocalStorage: function() {
                                console.log('Getting a list of datasets from the local storage');
                                var allDatasets = JSON.parse(localStorage.getItem('datasets') || "[]");
                                return allDatasets;
                              },
                            Severity: Minor
                            Found in src/app.js and 1 other location - About 55 mins to fix
                            src/app.js on lines 397..401

                            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

                              getSessionsFromLocalStorage: function() {
                                console.log('Getting a list of sessions from the local storage');
                                var allSessions = JSON.parse(localStorage.getItem('sessions') || "[]");
                                return allSessions;
                              },
                            Severity: Minor
                            Found in src/app.js and 1 other location - About 55 mins to fix
                            src/app.js on lines 358..362

                            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

                                else if (requestType === "meta") {
                                  request_options = {
                                    cache: "no-cache",
                                    method: "PUT",
                                    headers: {
                            Severity: Minor
                            Found in src/app.js and 1 other location - About 35 mins to fix
                            src/app.js on lines 767..809

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

                            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 (requestType === "doi") {
                                  request_options = {
                                    cache: "no-cache",
                                    method: "POST",
                                    headers: {
                            Severity: Minor
                            Found in src/app.js and 1 other location - About 35 mins to fix
                            src/app.js on lines 790..809

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

                            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