nus-mtp/sashimi-note

View on GitHub
sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

File sqlCommands.spec.js has 673 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import SqlCommands from 'src/database/sql-related/sqlCommands';
import SqlArray from 'src/database/generated-data/sqlArray';
import StringManipulator from 'src/database/stringManipulation';
import exceptions from 'src/database/exceptions';
import defaultFeatureFile from 'src/../static/data/features.txt';

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

            it('throw an exception for invalid folder name', (done) => {
              sqlCommands.changeFolderName(6, '"')
              .catch(sqlErr =>
                expect(sqlErr.name).to.equal('InvalidRename')
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 565..584

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

    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('throw an exception for invalid file name', (done) => {
              sqlCommands.changeFileName(7, '"')
              .catch(sqlErr =>
                expect(sqlErr.name).to.equal('InvalidRename')
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 585..604

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

    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

            sqlCommands.createTable(createFileTableString)
            .then(() =>
              sqlCommands.insertContent(fileTableName, firstFile)
            )
            .then(() =>
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 392..416

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

    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

    function isTableExistsInDatabase(tableName, callback) {
      const req = indexedDB.open(testDatabaseName);
      req.onsuccess = function onSuccess(event) {
        const tableNames = event.target.result.objectStoreNames;
        if (tableNames.contains(tableName) === false) {
    sashimi-webapp/test/unit/specs/database/create/entitiesCreator.spec.js on lines 28..43

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

    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

            sqlCommands.createTable(createFolderTableString)
            .then(() =>
              sqlCommands.insertContent(folderTableName, rootFolder)
            )
            .then(() =>
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 354..378

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

    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

      describe('link to indexeddb database', () => {
        it('should link to indexeddb database', (done) => {
          if (!window.indexedDB) {
            throw new exceptions.IndexedDBNotSupported();
          }
    sashimi-webapp/test/unit/specs/database/create/entitiesCreator.spec.js on lines 71..85
    sashimi-webapp/test/unit/specs/database/create/tableCreator.spec.js on lines 49..63

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

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

    function isDatabaseExists(databaseName, callback) {
      const req = indexedDB.open(databaseName);
      let existed = true;
      req.onsuccess = function onSuccess() {
        req.result.close();
    sashimi-webapp/test/unit/specs/database/create/entitiesCreator.spec.js on lines 13..26
    sashimi-webapp/test/unit/specs/database/create/tableCreator.spec.js on lines 7..20

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 116.

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

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

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

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

    Refactorings

    Further Reading

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

            it('get list of files in file', (done) => {
              sqlCommands.loadFilesFromFolder(0)
              .then(data =>
                expect(data).to.deep.equal([firstFile[0], secondFile[0], thirdFile[0]])
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 468..477

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

    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 be able to retrieve all folders in a folder and children folders', (done) => {
              sqlCommands.loadFoldersFromFolder(0)
              .then(data =>
                expect(data).to.deep.equal([sixthFolder[0], firstFolder[0], secondFolder[0]])
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 524..533

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

    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

              sqlCommands.changeFileName(7, 'new')
              .then(() =>
                sqlCommands.loadFilesFromFolder(5)
                .then(filesData =>
                  expect(filesData).to.deep.equal([editedFile])
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 644..654

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

    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

              sqlCommands.changeFilePath(3, '/root/documentary/')
              .then(() =>
                sqlCommands.loadFilesFromFolder(1)
                .then(filesData =>
                  expect(filesData).to.deep.equal([editedFile])
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 553..563

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

    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 be able to get maximum folder ID', (done) => {
              sqlCommands.getMaxFolderId()
              .then(data =>
                expect(data).to.equal(7)
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 481..490

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

    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 be able to get maximum file ID', (done) => {
              sqlCommands.getMaxFileId()
              .then(data =>
                expect(data).to.equal(7)
              )
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 491..500

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

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

    function deleteDatabase(databaseName) {
      return new Promise((resolve, reject) => {
        const thisDatabaseName = databaseName || testDatabaseName;
        if (!window.indexedDB) {
          reject(exceptions.IndexedDBNotSupported);
    sashimi-webapp/test/unit/specs/database/create/entitiesCreator.spec.js on lines 45..53
    sashimi-webapp/test/unit/specs/database/create/tableCreator.spec.js on lines 23..31
    sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 10..18
    sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 10..18

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

    Similar blocks of code found in 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/retrieve/query.spec.js on lines 27..37
    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 thirdFile = [{
          organization_id: 1,
          folder_id: 0,
          file_id: 3,
          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 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 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

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

        const firstFolder = [{
          folder_id: 1,
          parent_folder_id: 0,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

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

        const thirdFolder = [{
          folder_id: 3,
          parent_folder_id: 2,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

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

        const seventhFolder = [{
          folder_id: 7,
          parent_folder_id: 6,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290

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

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

        const fifthFolder = [{
          folder_id: 5,
          parent_folder_id: 3,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

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

        const secondFolder = [{
          folder_id: 2,
          parent_folder_id: 0,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

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

        const sixthFolder = [{
          folder_id: 6,
          parent_folder_id: 0,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 264..272
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

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

        const fourthFolder = [{
          folder_id: 4,
          parent_folder_id: 2,
          organization_id: 1,
          creation_date: '2015.01.09 11:33:12',
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 237..245
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 246..254
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 255..263
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 273..281
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 282..290
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 291..299

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

    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