SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

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

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

    public void addToken(final char[] array, final int start, final int end, final int tokenType,
                         final int startOffset, final boolean hyperlink) {

Avoid deeply nested control flow statements.
Open

              if (nonRDFAnnotation != null) {
                Enumeration<TreeNode> childEnum = nonRDFAnnotation.children();
                while (childEnum.hasMoreElements()) {
                  XMLNode child = (XMLNode) childEnum.nextElement();
                  XMLAttributes atts = child.getAttributes();

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

    public void addToken(final char[] array, final int start, final int end, final int tokenType,
                         final int startOffset, final boolean hyperlink) {

Avoid deeply nested control flow statements.
Open

            if (joinRelation.getTargetParam().equals(param.getId() + suffix)) {
              addEntryToRelationMap(sourceTargetPathMap,joinRelation, param );
    
            }

Avoid deeply nested control flow statements.
Open

            if (b2)
              iter.remove();

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

    @Override
    public void actionPerformed(ActionEvent e) {
      JFileChooser fileChooser = new JFileChooser();
      fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
      fileChooser.setMultiSelectionEnabled(true);

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 (jsonParser.nextToken() == JsonToken.START_ARRAY) {
                if (jsonParser.nextToken() != JsonToken.END_ARRAY) {

                  return getNextParameter(jsonParser);

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

  @Override
  protected void saveSettingsTo(NodeSettingsWO settings) throws InvalidSettingsException {

    m_readmePanel.addToHistory();

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

  @Override
  public JSSimulatorViewValue getViewValue() {

    JSSimulatorViewValue value = super.getViewValue();
    synchronized (getLock()) {

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 {

Avoid deeply nested control flow statements.
Open

                        if(currentUnit.equalsIgnoreCase(previousConcUnit)) {
                            value = previousConcValues.get(previousConcUnit);
                        }else {
                            Category cat = Categories.getCategoryByUnit(currentUnit);
                            Double convertedValue = null;

Avoid deeply nested control flow statements.
Open

                        if (!fixedValue.equals(values.get(i))) {
                            usedPoints.set(i, false);
                        }

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

        public Component getTableCellRendererComponent(JTable table,
                Object color, boolean isSelected, boolean hasFocus, int row,
                int column) {

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

        public Component getTableCellRendererComponent(JTable table,
                Object color, boolean isSelected, boolean hasFocus, int row,
                int column) {

Avoid deeply nested control flow statements.
Open

                            if (points != null) {
                                for (int i = 0; i < points[0].length; i++) {
                                    if (isValid(points[0][i])) {
                                        usedMinX = Math.min(usedMinX,
                                                points[0][i]);

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

    public double[][] getPoints(String paramX, String paramY, String unitX,
            String unitY, String transformX, String transformY)

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

        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row,
                int column) {

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

    public void addIndepVar(final String varName, final Double min, final Double max, String category, String unit,
            String description) {

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

    public void addParam(final String paramName, final Boolean isStartParam, final Double value, final Double error,
            final Double min, final Double max) {
Severity
Category
Status
Source
Language