SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof DepXml) {
                                    DepXml x = (DepXml) el;
                                    pv.setUnitLog10N(x.unit);

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

    private SingleNodeContainer createNodeContainer(WorkflowManager wfm, Integer processID, Object nodeAnno, String description, LinkedHashMap<Integer, NodeID> nodesMap, NodeFactory pf) {

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof ParamXml) {
                                    ParamXml x = (ParamXml) el;
                                    if (x.name.equals(pv.getLog10N0())) pv.setUnitLog10N0(x.unit);

Avoid deeply nested control flow statements.
Open

                        if (rsZ != null && rsZ.first()) {                                    
                            ops[fromPort - 1].setOutFlux(100 * lhm.get(vp) / sum);
                            lhm.put(vp, -lhm.get(vp));
                            //addedVP = vp;
                            if (lhmm != null && lhmm.containsKey(vp)) ops[fromPort - 1].setMatrix(lhmm.get(vp));

Avoid deeply nested control flow statements.
Open

                        if (selModelID != null) {
                            if (set.getNewConcentrationParameters().containsKey(selModelID) && set.getNewConcentrationParameters().get(selModelID) != null) {
                                pv.setLog10N0(set.getNewConcentrationParameters().get(selModelID));
                            }
                            if (set.getNewLagParameters().containsKey(selModelID) && set.getNewLagParameters().get(selModelID) != null) {

Avoid deeply nested control flow statements.
Open

                                        if (vp == null) {
                                            // new Node: IngredientNode
                                            if (dbl != null) {
                                                if (unit <= 7) { // ADV-Codes: 1=Kilogramm 2=Gramm 7=Liter 24=Prozent 25=Promille 35=Stück
                                                    if (unit == 1) dbl *= 1000;

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

    public void saveSettings( final Config config ) {        
        int i;
        Config c;
        
        config.addString(PARAM_PROCESSNAME, processName);

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(!field.getValue().toString().equals("\"\"") && !field.getValue().toString().equals("\"-\""))
                            node.set(key, field.getValue());

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof IndepXml) {
                                    IndepXml x = (IndepXml) el;
                                    if (x.name.equals(AttributeUtilities.ATT_TEMPERATURE) && x.unit != null) pv.setUnitTemp(x.unit);

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

        @Override 
        public void keyReleased(KeyEvent event) { 
            if (event.getKeyCode()==KeyEvent.VK_DELETE) {
                cancelEditing(); 
                DefaultTableModel model = (DefaultTableModel) table.getModel();

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

        private void pasteFromClipboard() { 
                int startRow=table.getSelectedRows()[0]; 
                int startCol=table.getSelectedColumns()[0];

                String pasteString = ""; 

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 (ndp != null && ndp instanceof FoodProcessNodeDialog && ndp.equals(this)) {
                                FoodProcessNodeDialog fpnd = (FoodProcessNodeDialog) ndp;
                                fpnd.loadSettingsFrom((NodeSettingsRO) s, specs);
                                String an = wnci.getNodeAnnotation().getData().getText();
                                if (!an.equals(newAnnotation)) {

Avoid deeply nested control flow statements.
Open

                        if (doc != null) {
                            for (PmmXmlElementConvertable el : doc.getElementSet()) {
                                if (el instanceof CatalogModelXml) {
                                    CatalogModelXml x = (CatalogModelXml) el;
                                    selModelID = ""+x.id;

Avoid deeply nested control flow statements.
Open

                        if (fpVolume == null) fpVolume = 0.0;

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

    private void init(final String strDataSet, final String xAxis, final String yAxis, final Double mini, final Double maxi, final double step) {

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

    private void parseString(final XYSeries series, final String function, final String interval, final Double mini, final Double maxi, final double stepi) {        

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

            public Component getTableCellRendererComponent(JTable arg0,
                    Object arg1, boolean arg2, boolean arg3, int arg4, int arg5) {

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

    private void loadEstModelGui(final NodeSettingsRO settings) throws InvalidSettingsException {
        try {
            emReaderUiMap = new HashMap<String, EmReaderUi>();
            if (settings.containsKey("EstModelReaderUi")) {
                Config c = settings.getConfig("EstModelReaderUi");

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 (newAgentMix.containsKey(a)) {
                            if (newAgentMix.get(a).getUnit().equals(vau.getUnit())) { // ppm oder log10 count/g - es kann nur einer überleben!!! D.h. innerhalb eines Workflows muss ein Agent dieselbe Einheitenkategorie haben!!!
                                newFraction = calcNewAgentFraction(vau, newFraction, relation, newAgentMix.get(a).getValue());
                                newAgentMix.remove(a);
                            }

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

    public void setAuthor(Contact newAuthor) {
        if (newAuthor != author) {
            NotificationChain msgs = null;
            if (author != null)
                msgs = ((InternalEObject)author).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - MetadataPackage.GENERAL_INFORMATION__AUTHOR, null, msgs);

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

Severity
Category
Status
Source
Language