SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.fsklab.nodes/js-src/de/bund/bfr/knime/fsklab/v2.0/editor/editor.js

Summary

Maintainability
D
2 days
Test Coverage

File editor.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

fskeditorjs = function () {

  const view = { version: "1.0.0" };
  view.name = "Javascript FSK Editor";

Function initResourcesTab has 127 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function initResourcesTab(){
    if (window.location.protocol != '' && window.location.host != '') {
        // send AJAX request to acquire the JWT for the currently logged in
        // user. Subsequent requests need to carry the token in the
        // “Authorization” header

Function extractAndCreateUI has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async function  extractAndCreateUI(modelMetaData, modelscript, visualization){
    if (!modelMetaData || modelMetaData == "null" || modelMetaData == "") {
      _metadata.generalInformation = {};
      _metadata.generalInformation.modelCategory = {};
      _metadata.scope = {};

Function createUI has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async function createUI(modelscript, visualization) {
    $('#modelScriptArea').val(modelscript || _val.modelScript);
    $('#visualizationScriptArea').val(visualization || _val.visualizationScript);
    $('#readmeArea').val(_val.readme);
    

Function getComponentValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  view.getComponentValue = () => {
    _metadata = _modalDetails._modelHandler.metaData;
    delete _metadata['simulation'];
    delete _metadata['modelscript'];
    delete _metadata['visualization'];

Function resolve has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function resolve(mainSchema, key,modeTypeKey, currentSchemaElement, resolvedValue){
    
    if(currentSchemaElement.hasOwnProperty('$ref') ){
        let schemaKey = currentSchemaElement['$ref'].replace('#/definitions/','');
        resolvedKey = schemaKey.charAt(0).toUpperCase() + schemaKey.slice(1);

Avoid deeply nested control flow statements.
Open

                                                    if (Percentage >= 100) {
                                                        // process
                                                        // completed
                                                    }

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

  function resolve(mainSchema, key,modeTypeKey, currentSchemaElement, resolvedValue){

There are no issues that match your filters.

Category
Status