nus-mtp/sashimi-note

View on GitHub

Showing 330 of 330 total issues

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

function DBFile(file_id, file_name, file_path, folder_id) {
  this.file_id = file_id;
  this.file_name = file_name;
  this.file_path = file_path;
  this.folder_id = folder_id;
sashimi-webapp/test/unit/specs/logic/filemanager/operations/core.spec.js on lines 7..12

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

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 DBFolder(folder_id, folder_name, folder_path, parent_folder_id) {
  this.folder_id = folder_id;
  this.folder_name = folder_name;
  this.folder_path = folder_path;
  this.parent_folder_id = parent_folder_id;
sashimi-webapp/test/unit/specs/logic/filemanager/operations/core.spec.js on lines 14..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 48.

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 createNewFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function createNewFile(organizationId, filePath, folderId, newFileId, newFileName) {
Severity: Minor
Found in sashimi-webapp/src/database/data-modifier/dataAdd.js - About 35 mins to fix

    Function createNewFolder has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function createNewFolder(organizationId, folderPath, currentFolderId, newFolderId, newFolderName) {
    Severity: Minor
    Found in sashimi-webapp/src/database/data-modifier/dataAdd.js - About 35 mins to fix

      Function injectDataLine has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function injectDataLine(tokens, idx, options, env, slf) {

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

            browser
              .expect.element(CSS_SELECTOR_REFERENCE_FRAME)
              .to.have.css(propertyName)
              .which.equal(renderResult.value);
        sashimi-webapp/test/e2e/specs/editorViewer/toggle-editor-viewer-view.spec.js on lines 25..28

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

        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

          const rootFolder = [{
            folder_id: 0,
            parent_folder_id: -1,
            organization_id: 1,
            creation_date: 4433,
        sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js on lines 49..57

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

        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

            browser
              .expect.element(CSS_SELECTOR_REFERENCE_FRAME)
              .to.have.css(propertyName)
              .which.equal(renderResult.value);
        sashimi-webapp/test/e2e/specs/pageRenderer/frame-page-size.spec.js on lines 8..11

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

        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

          const rootFolder = [{
            folder_id: 0,
            parent_folder_id: -1,
            organization_id: 1,
            creation_date: 4433,
        Severity: Minor
        Found in sashimi-webapp/test/unit/specs/database/retrieve/query.spec.js and 1 other location - About 35 mins to fix
        sashimi-webapp/test/unit/specs/database/data-modifier/dataAdd.spec.js on lines 60..68

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

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

          static setPrimaryKeys(...primaryKeys) {
            if (isTableInitializedForCreation) {
              sqlCreateTableString = stringManipulator.stringConcat(sqlCreateTableString, 'PRIMARY KEY(');
              for (let index = 0; index < primaryKeys.length; index += 1) {
                if (index === primaryKeys.length - 1) {
        Severity: Minor
        Found in sashimi-webapp/src/database/create/tableCreator.js - About 35 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function setUnique has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          static setUnique(...uniqueKeys) {
            if (isTableInitializedForCreation) {
              sqlCreateTableString = stringManipulator.stringConcat(sqlCreateTableString, 'UNIQUE(');
              for (let index = 0; index < uniqueKeys.length; index += 1) {
                if (index === uniqueKeys.length - 1) {
        Severity: Minor
        Found in sashimi-webapp/src/database/create/tableCreator.js - About 35 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function rename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        Folder.prototype.rename = function rename(newFolderName) {
          if (!(this instanceof Folder)) {
            throw new Error(ERROR_NOT_FOLDER_INSTANCE);
          }
        
        
        Severity: Minor
        Found in sashimi-webapp/src/logic/filemanager/data/folder.js - About 35 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

        Avoid too many return statements within this function.
        Open

                return true;

          Avoid too many return statements within this function.
          Open

            return true;

            Avoid too many return statements within this function.
            Open

                  return [`{\\quad\\text{${symbol.input}}\\quad}`, str];
            Severity: Major
            Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return storage.renameFile(this.id, newFileName)
                  .then(() => {
                    const oldFileName = this.name;
                    this.name = newFileName;
                    this.path = this.path.replace(oldFileName, newFileName);
              Severity: Major
              Found in sashimi-webapp/src/logic/filemanager/data/file.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return [symbol.output, str];
                Severity: Major
                Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return DO_NOTHING;
                  Severity: Major
                  Found in sashimi-webapp/src/logic/renderer/core.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return [newFrag, str];
                    Severity: Major
                    Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return [node, result[1]];
                      Severity: Major
                      Found in sashimi-webapp/src/logic/documentPackager/plugins/ASCIIMathTeXImg.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language