SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.fsklab.nodes/src/de/bund/bfr/knime/fsklab/nodes/ParameterJson.java

Summary

Maintainability
C
7 hrs
Test Coverage

Method getParameter has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

  public DataArray getParameter() {
    try {
      if (isOutputClosed) {
        // open Json file stream if it isn't already open
        if (isInputClosed) {

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

  public DataArray getParameter() {
    try {
      if (isOutputClosed) {
        // open Json file stream if it isn't already open
        if (isInputClosed) {

Avoid deeply nested control flow statements.
Open

              if (jsonParser.nextToken() == JsonToken.START_ARRAY) {
                if (jsonParser.nextToken() != JsonToken.END_ARRAY) {

                  return getNextParameter(jsonParser);

Method addParameter has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  public void addParameter(Parameter parameter, String modelId, String data, String parameterType,
      String language) {

Refactor this method to reduce its Cognitive Complexity from 33 to the 15 allowed.
Open

  public DataArray getParameter() {

Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.

See

There are no issues that match your filters.

Category
Status