SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                        if (rs.getObject(1) != null) {
                            Integer oldfID = rs.getInt(1);
                            ResultSet rs2 = DBKernel.getResultSet("SELECT * FROM " + DBKernel.delimitL("DoubleKennzahlen") +
                                    " WHERE " + DBKernel.delimitL("ID") + "=" + oldfID, false);
                            if (rs2 != null && rs2.first()) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 45 mins to fix

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

  public void setValue(Object value) {
    if (value != null && !value.equals("")) {
      if (cellType == WWW) {
        this.setText("WWW-Code");
      }
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyImageCell.java - About 45 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

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

      TreeNode getChildAt(int index, boolean filterIsActive) {
        if (!filterIsActive) {
          return super.getChildAt(index);
        }
        if (children == null) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/InvisibleNode.java - About 45 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 deeply nested control flow statements.
Open

                        if (vals4 != null) showAndFilterVals("Lieferungen", vals4, 0, v1 + v2 + v3, total);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if (vals.length() > 0) {
                                    vals = vals.substring(1);
                                    result.add(tn + " hat " + rs.getString(1) + " Datensätze mit denselben Werten: (" + vals + ")"); // Duplikate
                                }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 45 mins to fix

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

    public void tableChanged(TableModelEvent e)
    {
        System.out.println("tableChanged");
        //  A cell has been updated
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/TableColumnAdjuster.java - About 45 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

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

    private void readValue(final ResultSet rs, final JLabel jl, final JTextField tf, final JTextField tf_exp, final JCheckBox cb, final boolean isString) {

Avoid deeply nested control flow statements.
Open

                                if (rs2 != null && rs2.first()) {
                                    do {
                                        matchingIDs += "," + rs2.getInt("Basis");
                                    } while (rs2.next());
                                }                            

Avoid deeply nested control flow statements.
Open

                            if (rs != null && rs.first()) {
                                do {
                                    Integer id = rs.getInt(1);
                                    String tn2 = tn;
                                    if (tn2.equals("Literatur") && id <= 231 || tn2.equals("Methoden") && id <= 1481 ||
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (foreignFields[i] != null) {
                            c = this.getColumn(i+1); 
                            c.setReadOnly(true);
                            String[] mnTable = actualTable.getMNTable();
                            if (mnTable != null && i < mnTable.length && mnTable[i] != null && mnTable[i].length() > 0) {
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                            if (rs != null && rs.first()) {
                                do  {
                                    Integer oldfID = rs.getInt("ID");
                                    MyTable myfT = DBKernel.myDBi.getTable(fTablename);
                                    System.out.println(tablename + "-" + fTablename + " - oldfID: " + oldfID + "\toldID = " + oldID);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 45 mins to fix

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

    private String getMyMNT(String key) {
        if (key != null) {
            String[] myFields = myT.getFieldNames();
            int i=0;
            for (;i<myFields.length;i++) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBForm.java - About 45 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 deeply nested control flow statements.
Open

                        if (DBKernel.myDBi != null && DBKernel.myDBi.getConn() != null) DBKernel.myDBi.setSA_P(newSA, newPass);
                        else DBKernel.removeAdminInfo(DBKernel.HSHDB_PATH);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/ChangeMasterPass.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        for (int j=0;j<this.getColumnCount();j++) {
                            if (this.getColumn(j).getColumnName().equals(filterConditions[i][0])) {
                                this.setValueAt(filterConditions[i][1], newSelRow, j);
                                break;
                            }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (el instanceof EstModelXml) {
                            EstModelXml emx = (EstModelXml) el;
                            labelText += emx.id + " -> " + emx.name + "<br>";
                            break;
                        }

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

    public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, int column) {

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

    @Override
    public void valueChanged(TreeSelectionEvent event) {
        if (catchEvent) { // !event.getValueIsAdjusting()                    
            DefaultMutableTreeNode selectedTreeNode = (DefaultMutableTreeNode) event.getPath().getLastPathComponent();
            /*
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtree/MyDBTree.java - About 45 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

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

    private void updateConfigPanel() {
        if (configPanel != null) {
            remove(configPanel);
        }

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

    private void saveValue(final PreparedStatement ps, final int index, final String tfText, final JTextField tf_exp, final JCheckBox cb, final boolean isString) {

Avoid deeply nested control flow statements.
Open

                                if (rs2 != null && rs2.first()) {
                                    do {
                                        matchingIDs += "," + rs2.getInt("Basis");
                                    } while (rs2.next());
                                }                            
Severity
Category
Status
Source
Language