nus-mtp/sashimi-note

View on GitHub

Showing 330 of 330 total issues

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

    it('should get the value of the given query string', () => {
      const expectedResult = 'pages';

      const inputQueryString = 'viewMode';
      const inputUrl = `https://www.website.com/#/content?${inputQueryString}=${expectedResult}`;
Severity: Major
Found in sashimi-webapp/test/unit/specs/helpers/url.spec.js and 1 other location - About 2 hrs to fix
sashimi-webapp/test/unit/specs/helpers/url.spec.js on lines 15..23

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

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 work when there are other query string', () => {
      const expectedResult = 'pages';

      const inputQueryString = 'viewMode';
      const inputUrl = `https://www.website.com/#/content?other=value&${inputQueryString}=${expectedResult}`;
Severity: Major
Found in sashimi-webapp/test/unit/specs/helpers/url.spec.js and 1 other location - About 2 hrs to fix
sashimi-webapp/test/unit/specs/helpers/url.spec.js on lines 5..13

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

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 (hasSameFileName.call(this, newFileName)) {
    return Promise.reject(new Error(ERROR_SAME_FILE_NAME));
  } else {
    return storage.renameFile(this.id, newFileName)
    .then(() => {
Severity: Major
Found in sashimi-webapp/src/logic/filemanager/data/file.js and 1 other location - About 2 hrs to fix
sashimi-webapp/src/logic/filemanager/data/folder.js on lines 145..154

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

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 AMgetSymbol has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function AMgetSymbol(str) {
// return maximal initial substring of str that appears in names
// return null if there is none
  let k = 0; // new pos
  let j = 0; // old pos
Severity: Major
Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 2 hrs to fix

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

      } else if (hasSameFolderName.call(this, newFolderName)) {
        return new Promise((resolve, reject) => reject(ERROR_SAME_FOLDER_NAME));
      } else {
        return storage.renameFolder(this.id, newFolderName)
        .then(() => {
    Severity: Major
    Found in sashimi-webapp/src/logic/filemanager/data/folder.js and 1 other location - About 2 hrs to fix
    sashimi-webapp/src/logic/filemanager/data/file.js on lines 180..189

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

    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/retrieve/query.spec.js on lines 10..18
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 44..52

    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

    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/sql-related/sqlCommands.spec.js on lines 44..52

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

        it('should return current folder if next history is empty', () => {
          const testFolder1 = new Folder(0);
          const testHistory = new History(testFolder1);
          idMap.addFolderToMap(testFolder1.id, testFolder1);
    
    
    sashimi-webapp/test/unit/specs/logic/filemanager/operations/history.spec.js on lines 115..121

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

          } else if (typeof symbol.invisible == 'boolean' && symbol.invisible) { node = `{\\left.${result[0]}}`; } else {
            node = `{\\left${AMTgetTeXsymbol(symbol)}${result[0]}}`;
          }
    sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 774..776

    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

    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/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
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 44..52

    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

    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/data-modifier/dataAdd.spec.js on lines 10..18
    sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 10..18
    sashimi-webapp/test/unit/specs/database/sql-related/sqlCommands.spec.js on lines 44..52

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

        query.isTableExistsInDatabase(constants.ENTITIES_USER)
        .then(isUserTableFirstInitialize =>
          createUserTable(isUserTableFirstInitialize)
          .then(isSuccess => isSuccess)
          .catch(sqlError => reject(sqlError))
    Severity: Major
    Found in sashimi-webapp/src/database/storage.js and 1 other location - About 2 hrs to fix
    sashimi-webapp/src/database/storage.js on lines 66..87

    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

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

    function deleteSingleFolder(folderId) {
      return new Promise((resolve, reject) =>
        alasql.promise([stringManipulator.stringConcat('DELETE FROM ', constants.ENTITIES_FOLDER,
                                                       ' WHERE ', constants.HEADER_FOLDER_FOLDER_ID,
                                                       ' = ', folderId)])
    Severity: Major
    Found in sashimi-webapp/src/database/sql-related/sqlCommands.js and 1 other location - About 2 hrs to fix
    sashimi-webapp/src/database/sql-related/sqlCommands.js on lines 164..172

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

    function deleteSingleFile(fileId) {
      return new Promise((resolve, reject) =>
        alasql.promise([stringManipulator.stringConcat('DELETE FROM ', constants.ENTITIES_FILE_MANAGER,
                                                       ' WHERE ', constants.HEADER_FILE_MANAGER_FILE_ID,
                                                       ' = ', fileId)])
    Severity: Major
    Found in sashimi-webapp/src/database/sql-related/sqlCommands.js and 1 other location - About 2 hrs to fix
    sashimi-webapp/src/database/sql-related/sqlCommands.js on lines 137..145

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

        it('should return current folder if previous history is empty', () => {
          const testFolder1 = new Folder(0);
          const testHistory = new History(testFolder1);
          idMap.addFolderToMap(testFolder1.id, testFolder1);
    
    
    sashimi-webapp/test/unit/specs/logic/filemanager/operations/history.spec.js on lines 167..173

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

            if (typeof symbol.invisible == 'boolean' && symbol.invisible) { node = `{${result[0]}}`; } else {
              node = `{${AMTgetTeXsymbol(symbol)}${result[0]}}`;
            }
    sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js on lines 777..779

    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

    Function AMTparseIexpr has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    function AMTparseIexpr(str) {
      let sym2;
      let node;
      let result;
      str = AMremoveCharsAndBlanks(str, 0);
    Severity: Minor
    Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 2 hrs 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 sqlCommands has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function sqlCommands() {
      this.linkDatabaseToIndexedDB = function linkDatabaseToIndexedDB(databaseName) {
        return new Promise((resolve, reject) => {
          databaseName = resolveSQLInjection(databaseName);
          const databaseRequestStr = stringManipulator.stringConcat(
    Severity: Minor
    Found in sashimi-webapp/src/database/sql-related/sqlCommands.js - About 2 hrs 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 changeFolderName has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.changeFolderName = function changeFolderName(folderId, newFolderName) {
        return new Promise((resolve, reject) => {
          let prevFolderPath;
          let thisFolderPath;
          let newFolderPath;
    Severity: Major
    Found in sashimi-webapp/src/database/sql-related/sqlCommands.js - About 2 hrs to fix
      Severity
      Category
      Status
      Source
      Language