SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

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());
                                }                            

Avoid deeply nested control flow statements.
Open

                                for (int i=2;i<=rs.getMetaData().getColumnCount();i++) {
                                    vals += ", " + rs.getString(i);
                                }
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 (lookIn && myDBTable1.hashBox[col-1].get(o) != null) res += "\n" + myDBTable1.hashBox[col-1].get(o).toString();
                                else res += "\n" + o.toString();
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/editoren/MyFilter.java - About 45 mins to fix

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

    private void getMNVals(JTextArea textArea, String firstTablename, String mnTablename, String secondTablename, int id, String fields) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBForm.java - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                                if (resRowFirst[fieldnames.length+2+i] == null || resRowFirst[fieldnames.length+2+i].isEmpty()) resRowFirst[fieldnames.length+2+i] = rs3.getString(otherTableDesires[i]);
                                else resRowFirst[fieldnames.length+2+i] += "," + rs3.getString(otherTableDesires[i]);
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 45 mins to fix

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

    private MyTable getMyFT(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

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

      private void createDTMN(String codeVec, MyTable myT, int lfd, int[] cutSystem) {
            boolean doIt = (showOnly == null);
            if (!doIt) {
                for (int j=0;j<showOnly.length;j++) {
                    if (showOnly[j] != null && showOnly[j].equals(codeVec)) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtree/MyDBTreeModel.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

                                    for (int ii = 0; ii < vs.size(); ii++) {
                                        ssql1 += "," + DBKernel.delimitL(fieldNames[vs.get(ii)]);
                                        ssql2 += ",?";
                                        ssql3 += "," + DBKernel.delimitL(fieldNames[vs.get(ii)]) + "=?";
                                    }
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 45 mins to fix

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

    public Object openNewWindow(final MyTable theNewTable, final Object value, final Object headerValue, final String mnTable, final String mnID, final MyDBForm dbForm) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/MainFrame.java - About 45 mins to fix
Severity
Category
Status
Source
Language