SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                                    if (result != null && result.first()) {
                                        newID = result.getInt(1);
                                        result.close();
                                    }

Method insertEm2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public void insertEm2(final Integer secID, final List<Integer> primIDs, Integer gmId) {
        try {
            PreparedStatement ps = conn.prepareStatement("INSERT INTO \"Sekundaermodelle_Primaermodelle\" (\"GeschaetztesPrimaermodell\", \"GeschaetztesSekundaermodell\", \"GlobalModel\")VALUES(?,?,?)");
            for (Integer id : primIDs) {
                if (id != null && id >= 0) {

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 deeply nested control flow statements.
Open

                        if (paramID == null) {
                            try {
                                if (n != null && d != null && !n.isEmpty() && !d.isEmpty()) {
                                    ps = conn.prepareStatement("INSERT INTO \"SonstigeParameter\" (\"Parameter\", \"Beschreibung\") VALUES (?, ?)", Statement.RETURN_GENERATED_KEYS);
                                    ps.setString(1, n);

Method createNodeModel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public NodeModel createNodeModel() {

        PortType[] inputTypes = {};
        PortType[] outputTypes = { BufferedDataTable.TYPE };

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

Method getValueType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  private static DataType getValueType(final String value) {
    if (value.startsWith("c(") && value.endsWith(")")) {
      return DataType.array;
    } else {
      try {

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

Method insertData has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private void insertData(final int condId, final int timeId, final int lognId, String timeUnit, String concUnit, String concUnitObjectType) {

Avoid deeply nested control flow statements.
Open

                        if (paramID != null) {
                            //System.err.println("handleConditions:\t" + after + "\t" + dbl + "\t" + unit + "\t" + paramID + "\t" + (condIDs == null ? condIDs : condIDs.get(i)));
                            try {
                                ps = conn.prepareStatement("INSERT INTO \"Versuchsbedingungen_Sonstiges\" (\"Versuchsbedingungen\", \"SonstigeParameter\", \"Wert\", \"Einheit\", \"Ja_Nein\") VALUES (?,?,?,?,?)");
                                ps.setInt(1, condId);

Method saveToNodeSettings has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public void saveToNodeSettings(NodeSettingsWO settings) {

    if (firstModelParameters != null && firstModelParameters.length > 0) {
      try {

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 deeply nested control flow statements.
Open

                if (commandNode != null
                    && commandNode.hasAttr(NodeUtils.METADATA_COMMAND_VALUE)) {
                  command = commandNode.getAttrValue(NodeUtils.METADATA_COMMAND_VALUE);
                }

Method createExtSubModel has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  public static ExternalModelDefinition createExtSubModel(SBMLDocument doc, String externalFileName,
      String filePrefix, CompSBMLDocumentPlugin compDoc, CompModelPlugin compMainModel,
      String subModelName) throws IOException, SBMLException, XMLStreamException {

Method performExecuteCreatePortObjects has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  protected PortObject[] performExecuteCreatePortObjects(PortObject svgImageFromView,
      PortObject[] inObjects, ExecutionContext exec) throws Exception {

    CombinedFskPortObject outObj = new CombinedFskPortObject(Optional.empty(), new ArrayList<>(),

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

Method loadSettingsFrom has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  protected void loadSettingsFrom(NodeSettingsRO settings, PortObject[] input)
      throws NotConfigurableException {

    FskPortObject fskObj = (FskPortObject) input[0];

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 deeply nested control flow statements.
Open

            if (joinRelation.getSourceParam().getId()
                .equals(sourceParameter.getId())) {
              // override the value of the target parameter with the value generated by the
              // command
              for (FskSimulation sim : secondFskObj.simulations) {

Avoid deeply nested control flow statements.
Open

            for (Parameter sourceParameter : SwaggerUtil.getParameter(firstFskObj.modelMetadata)) {

              if (joinRelation.getSourceParam().getId()
                  .equals(sourceParameter.getId())) {
                // override the value of the target parameter with the value generated by the

Method saveJsonSetting has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  protected void saveJsonSetting(String joinRelation, String modelMetaData, String modelScriptTree,
      String visualizationScript, String modelMath1, String modelMath2)

Method runSnippet has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  public final void runSnippet(final FskPortObject fskObj, final FskSimulation simulation,
      final ExecutionContext exec, NodeLogger LOGGER,
      final RunnerNodeInternalSettings internalSettings, RunnerNodeSettings nodeSettings)

Method runSnippet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  private FskPortObject runSnippet(ScriptHandler handler, final FskPortObject fskObj,
      final FskSimulation simulation, final ExecutionContext exec) throws Exception {

    handler.runSnippet(fskObj, simulation, exec, LOGGER, internalSettings, nodeSettings);

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

Method createExtSubModel has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  public static ExternalModelDefinition createExtSubModel(SBMLDocument doc, String externalFileName,
      String filePrefix, CompSBMLDocumentPlugin compDoc, CompModelPlugin compMainModel,
      String subModelName) throws IOException, SBMLException, XMLStreamException {

Method getEnvironment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  public Optional<Path> getEnvironment() {

    if (archivePath == null || archivePath.isEmpty())
      return Optional.empty();

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

Method stepIntoSubModel has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  private FskPortObject stepIntoSubModel(FskPortObject fskObj, FskSimulation fskSimulation,
      FskSimulation combinedSim,
      final ExecutionContext exec,
      List<JoinRelationAdvanced> joinRelationList,
      String suffix) {
Severity
Category
Status
Source
Language