SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Method initialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private void initialize() {
        m_useSeconds = new JCheckBox();
        m_useMinutes = new JCheckBox();
        m_useHours = new JCheckBox();
        m_useDate = new JCheckBox();

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

    public static String nodeToString(Node n) throws Exception {
        if (n instanceof ASTFunNode) {
            String s = n.toString() + "(";

            for (int i = 0; i < n.jjtGetNumChildren(); i++) {

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

    public Double getMiscValue(String attribute, Double defaultValue) throws PmmException {
        PmmXmlDoc miscXmlDoc = getMisc();
        if (miscXmlDoc != null) {
            MiscXml mx = null;
            for (PmmXmlElementConvertable el : miscXmlDoc.getElementSet()) {

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

    private void updateModelNameEnabled() {
        if (modelNameSwitch.isSelected()) {
            for (JCheckBox box : modelBoxSetPrim.values()) box.setEnabled(true);
            for (JCheckBox box : modelBoxSetSec.values()) box.setEnabled(true);
        } else {

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

    private static String[][] readSpreadsheetToMatrix(Sheet sheet) {

        final String[][] values = new String[200][50];
        for (int i = 0; i < Math.min(200, sheet.getPhysicalNumberOfRows()); i++) {

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

        @Override
        protected boolean doCheckState() {
            final String rHome = getStringValue();

            final Path rHomePath = Paths.get(rHome);

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

    @Override
    public void mousePressed(MouseEvent e) {
        rangeAxis = null;
        if (e.isControlDown() && SwingUtilities.isLeftMouseButton(e)) {
            Rectangle2D screenDataArea = getScreenDataArea(e.getX(), e.getY());

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

        private List<List<Integer>> createChangeLists() {
            int n = arguments.length;
            boolean done = false;
            List<List<Integer>> changeLists = new ArrayList<>();
            List<Integer> list = new ArrayList<>(Collections.nCopies(n, -1));

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

    public static void append(final PCMLDocument doc, 
            final PCMLDocument toAppend) {
        Map<String, XmlObject> newNodes = PCMLUtil.append(doc, toAppend, 
                "ProcessNode");
        // TODO: this might be automated by getting the parent of ProcessNode.

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

Function _createHeader has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    _createHeader ( settings ) {
        let O = this;
        _log( 'LANDINGPAGE / _create header' );

        // header
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.landingpage.js - About 1 hr 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

Function _preparePanel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    _preparePanel(menu, modelHandler, handlerPanel) {
        let O = this;
        _log('MODAL DETAILS / _createPanel: ' + menu.id);
        
        let $panel = null;
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.editable.mt.details.js - About 1 hr 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

Function _updateOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    _updateOrder($th) {
        let O = this;
        _log('TABLE / _updateOrder');

        let field = $th.data('field');
Severity: Minor
Found in de.bund.bfr.knime.js/src/js/app/app.table.js - About 1 hr 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 retrieveDietaryAssessmentMethod has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static DietaryAssessmentMethod retrieveDietaryAssessmentMethod(Row row, Map<String, Integer> columns) {

        // Check first mandatory properties
        if (row.getCell(columns.get("collectionTool")).getCellTypeEnum() != CellType.STRING) {
            throw new IllegalArgumentException("Missing methodological tool to collect data");

Method convert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static de.bund.bfr.metadata.swagger.GenericModelGeneralInformation convert(
            GeneralInformation deprecatedGI) {

        de.bund.bfr.metadata.swagger.GenericModelGeneralInformation generalInformation = new de.bund.bfr.metadata.swagger.GenericModelGeneralInformation();

Method manageIndep has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private String manageIndep(ParametricModel pm, ResultSet rs) throws SQLException {
        String result = null;
        Array array = rs.getArray(Bfrdb.ATT_INDEP);
        Array min = rs.getArray(Bfrdb.ATT_MININDEP);
        Array max = rs.getArray(Bfrdb.ATT_MAXINDEP);

Method actionPerformed has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        @Override
        public void actionPerformed(ActionEvent e) {
            if (e.getSource() == okButton) {
                approved = true;
                dispose();

Method loadLiteratureItemsFromDB has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void loadLiteratureItemsFromDB() {
        List<Literature> literatureList = new LinkedList<>();
        String query = "SELECT * FROM \"Literatur\"";
        ResultSet resultSet = DBKernel.getResultSet(query, true);

Method saveSettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void saveSettings(NodeSettingsWO settings) {
        settings.addString(CFG_SELECTEDIDS,
                XmlConverter.objectToXml(selectedIDs));
        settings.addString(CFG_COLORS, XmlConverter.colorMapToXml(colors));
        settings.addString(CFG_SHAPES, XmlConverter.shapeMapToXml(shapes));

Method readDataTable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void readDataTable() {
        dependentParameters = new LinkedHashMap<>();
        primaryModelNames = new LinkedHashMap<>();
        independentParameterCategories = new LinkedHashMap<>();

Method addUnitDefinitions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void addUnitDefinitions(Model model, DepXml depXml, List<IndepXml> indepXmls,
            List<ParamXml> constXmls) throws XMLStreamException {
        // Get units from dep, indeps and consts
        HashSet<String> units = new HashSet<>();
        if (depXml.unit != null) {
Severity
Category
Status
Source
Language