jiskattema/spot

View on GitHub

Showing 2,641 of 2,641 total issues

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

  showCloudUploadInfo: function () {
    var dialog = this.queryByHook('session-upload-cloud');
    dialogPolyfill.registerDialog(dialog);
    dialog.showModal();
  },
Severity: Major
Found in src/pages/datasets.js and 5 other locations - About 35 mins to fix
src/pages/datasets.js on lines 215..219
src/pages/datasets.js on lines 220..224
src/pages/datasets.js on lines 230..234
src/pages/datasets.js on lines 236..240
src/pages/datasets.js on lines 241..245

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

    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

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

function addRawValue (string, raw) {
  if (typeof string !== 'string' || string.length === 0) {
    string = '';
  } else {
    string = string + ', ';
Severity: Minor
Found in src/pages/configure-facet/facet-define.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

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

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

  tryFillSlot: function (facet, operation) {
    var filter = this.collection.parent.filter;
    if (!filter || this.isFilled) {
      return false;
    }
Severity: Minor
Found in src/widgets/models/slot.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

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

function initChart (view) {
  // Configure plot
  view._config = view.model.scatterConfig();

  var filter = view.model.filter;
Severity: Minor
Found in src/widgets/views/scatter.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

Use of !important
Open

    color: #000 !important;
Severity: Minor
Found in dist/app.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

html {
Severity: Minor
Found in dist/app.css by csslint

Heading (h3) has already been defined.
Open

h3 {
Severity: Minor
Found in dist/app.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.mdl-typography--body-2-color-contrast {
Severity: Minor
Found in dist/app.css by csslint

Use of !important
Open

  font-weight: 300 !important; }
Severity: Minor
Found in dist/app.css by csslint

Use of !important
Open

  background-color: rgb(255,235,238) !important; }
Severity: Minor
Found in dist/app.css by csslint

The universal selector (*) is known to be slow.
Open

  *:before,
Severity: Minor
Found in dist/app.css by csslint

Attribute selectors with ^= are slow!
Open

  a[href^="#"]:after,
Severity: Minor
Found in dist/app.css by csslint

Heading (h2) has already been defined.
Open

h1, h2, h3, h4, h5, h6, p {
Severity: Minor
Found in dist/app.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.mdl-typography--subhead {
Severity: Minor
Found in dist/app.css by csslint

Use of !important
Open

  color: rgb(255,205,210) !important; }
Severity: Minor
Found in dist/app.css by csslint

The universal selector (*) is known to be slow.
Open

  *,
Severity: Minor
Found in dist/app.css by csslint

Use of !important
Open

    background: transparent !important;
Severity: Minor
Found in dist/app.css by csslint
Severity
Category
Status
Source
Language