nus-mtp/sashimi-note

View on GitHub

Showing 330 of 330 total issues

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

  const firstFile = [{
    organization_id: 1,
    folder_id: 0,
    file_id: 1,
    file_name: 'abcd',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

    const sixthFile = [{
      organization_id: 1,
      folder_id: 7,
      file_id: 6,
      file_name: 'kirby',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

  const firstFile = [{
    organization_id: 1,
    folder_id: 0,
    file_id: 1,
    file_name: 'abcd',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

    const secondFile = [{
      organization_id: 1,
      folder_id: 0,
      file_id: 2,
      file_name: 'abc',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

    const fourthFile = [{
      organization_id: 1,
      folder_id: 6,
      file_id: 4,
      file_name: 'd',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

    const fifthFile = [{
      organization_id: 1,
      folder_id: 6,
      file_id: 5,
      file_name: 'miserable',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 217..227

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

    const seventhFile = [{
      organization_id: 1,
      folder_id: 5,
      file_id: 7,
      file_name: 'old',
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 49..59
sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 27..37
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 151..161
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 162..172
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 173..183
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 184..194
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 195..205
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 206..216

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

      expect(userData).to.deep.equal([{
        token: 'temporary',
        password: '',
        email: 'default@email.com',
        username: 'owner',
sashimi-webapp/test/unit/specs/database/create/entitiesCreator.spec.js on lines 177..184

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

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

        return expect(userData).to.deep.equal([{
          token: 'temporary',
          password: '',
          email: 'default@email.com',
          username: 'owner',
sashimi-webapp/test/unit/specs/database/create/initDataGenerator.spec.js on lines 12..19

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

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

    it('should encode a string \'0\' as number 0', () => {
      const inputData = '0';
      const outputData = base64.encodeUnicode(inputData);
      expect(outputData).to.equal('MA==');
    });
Severity: Minor
Found in sashimi-webapp/test/unit/specs/helpers/base64.spec.js and 1 other location - About 55 mins to fix
sashimi-webapp/test/unit/specs/helpers/base64.spec.js on lines 13..17

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

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

    it('should encode a empty string into a empty string', () => {
      const inputData = '';
      const outputData = base64.encodeUnicode(inputData);
      expect(outputData).to.equal('');
    });
Severity: Minor
Found in sashimi-webapp/test/unit/specs/helpers/base64.spec.js and 1 other location - About 55 mins to fix
sashimi-webapp/test/unit/specs/helpers/base64.spec.js on lines 37..41

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

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 process has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

DiagramsRenderer.prototype.process = function process(ele) {
  const observerConfig = { childList: true };
  // get all pre tags with class name = sequence
  const seqDiagrams = ele.querySelectorAll('pre.sequence');
  // get all pre tags with class name = flow
Severity: Minor
Found in sashimi-webapp/src/logic/renderer/diagrams.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

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

      initPromiseSequence()
      .then(() =>
        sqlCommands.getFullTableData(constants.ENTITIES_FILE_MANAGER)
        .then(fileArr => fileAndFolderArray.push(fileArr))
        .catch(sqlError => reject(sqlError)))
Severity: Minor
Found in sashimi-webapp/src/database/retrieve/query.js and 1 other location - About 55 mins to fix
sashimi-webapp/src/database/retrieve/query.js on lines 38..46

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

    return sqlCommands.insertContent(constants.ENTITIES_FOLDER, newFolderData)
    .then(success => resolve(newFolderData[0]))
    .catch(err => reject(err));
Severity: Minor
Found in sashimi-webapp/src/database/data-modifier/dataAdd.js and 1 other location - About 50 mins to fix
sashimi-webapp/src/database/data-modifier/dataAdd.js on lines 38..40

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

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

    return sqlCommands.insertContent(constants.ENTITIES_FILE_MANAGER, newFileData)
    .then(success => resolve(newFileData[0]))
    .catch(sqlErr => reject(sqlErr));
Severity: Minor
Found in sashimi-webapp/src/database/data-modifier/dataAdd.js and 1 other location - About 50 mins to fix
sashimi-webapp/src/database/data-modifier/dataAdd.js on lines 68..70

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

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

function defaultFillUpOrganizationTable() {
  return isTableExists(constants.ENTITIES_ORGANIZATION)
  .then(isExist =>
    sqlCommands.insertContent(constants.ENTITIES_ORGANIZATION,
      initDataGenerator.getInitDataOrganization())
Severity: Major
Found in sashimi-webapp/src/database/create/entitiesCreator.js and 3 other locations - About 50 mins to fix
sashimi-webapp/src/database/create/entitiesCreator.js on lines 29..35
sashimi-webapp/src/database/create/entitiesCreator.js on lines 45..51
sashimi-webapp/src/database/create/entitiesCreator.js on lines 53..59

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

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

function defaultFillUpFileManagerTable() {
  return isTableExists(constants.ENTITIES_FILE_MANAGER)
  .then(isExist =>
    sqlCommands.insertContent(constants.ENTITIES_FILE_MANAGER,
      initDataGenerator.getInitDataFileManager())
Severity: Major
Found in sashimi-webapp/src/database/create/entitiesCreator.js and 3 other locations - About 50 mins to fix
sashimi-webapp/src/database/create/entitiesCreator.js on lines 29..35
sashimi-webapp/src/database/create/entitiesCreator.js on lines 37..43
sashimi-webapp/src/database/create/entitiesCreator.js on lines 53..59

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

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

function defaultFillUpFolderTable() {
  return isTableExists(constants.ENTITIES_FOLDER)
  .then(isExist =>
    sqlCommands.insertContent(constants.ENTITIES_FOLDER,
      initDataGenerator.getInitDataFolder())
Severity: Major
Found in sashimi-webapp/src/database/create/entitiesCreator.js and 3 other locations - About 50 mins to fix
sashimi-webapp/src/database/create/entitiesCreator.js on lines 29..35
sashimi-webapp/src/database/create/entitiesCreator.js on lines 37..43
sashimi-webapp/src/database/create/entitiesCreator.js on lines 45..51

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

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

function defaultFillUpUserTable() {
  return isTableExists(constants.ENTITIES_USER)
  .then(isExist =>
    sqlCommands.insertContent(constants.ENTITIES_USER,
      initDataGenerator.getInitDataUser())
Severity: Major
Found in sashimi-webapp/src/database/create/entitiesCreator.js and 3 other locations - About 50 mins to fix
sashimi-webapp/src/database/create/entitiesCreator.js on lines 37..43
sashimi-webapp/src/database/create/entitiesCreator.js on lines 45..51
sashimi-webapp/src/database/create/entitiesCreator.js on lines 53..59

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

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

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

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

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

Refactorings

Further Reading

Avoid deeply nested control flow statements.
Open

          if (mxnestingd===0 && pos.length>0 && matrix) {
            for (i=0; i<pos.length-1; i+=1) {
              let subarr;
              if (i>0) mxout += '\\\\';
              if (i===0) {
Severity: Major
Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 45 mins to fix
    Severity
    Category
    Status
    Source
    Language