SiLeBAT/FSK-Lab

View on GitHub

Showing 6,856 of 14,752 total issues

Method getInternalKNIMEDB_LoadGui has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private static Connection getInternalKNIMEDB_LoadGui(boolean autoUpdate) {
        Connection result = null;
        //try {
        String internalPath = DBKernel.prefs.get("PMM_LAB_SETTINGS_DB_PATH", getInternalDefaultDBPath());
        CRC32 crc32 = new CRC32();
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 2 hrs 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 dbBackup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static boolean dbBackup(final JFrame frame) {
        String lastOutDir = DBKernel.prefs.get("LAST_OUTPUT_DIR", "");
        JFileChooser fc = new JFileChooser(lastOutDir);
        Backup bkp = new Backup();
        fc.setFileFilter(bkp);
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/Backup.java - About 2 hrs 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 execute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  @Override
  protected PortObject[] execute(final PortObject[] inData, final ExecutionContext exec)
      throws Exception {
    try {
      FskPortObject portObj = new FskPortObject();

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

    private void insertEstParam(final int estModelId, final int paramId, final Double value, final Double paramErr, String unit, ParametricModel pm, boolean isDepIndep,
            String paramName) {
        try {
            PreparedStatement ps = conn.prepareStatement("INSERT INTO \"GeschaetzteParameter\" (\"GeschaetztesModell\", \"Parameter\", \"Wert\", \"StandardError\", \"Einheit\", \"p\", \"t\") VALUES(?, ?, ?, ?, ?, ?, ?)");
            ps.setInt(1, estModelId);

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

    public Integer insertTs(final PmmTimeSeries ts) throws PmmException {
        Integer condId = ts.getCondId();
        Double ph = ts.getPh();
        Double temp = ts.getTemperature();
        temp = convert(Categories.getTempCategory(), ts.getTemperatureUnit(), temp, "°C");

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

        @Override
        public FskPortObject loadPortObject(PortObjectZipInputStream in, PortObjectSpec spec, ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {

            FskPortObject portObj = new FskPortObject();

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

        @Override
        public FskPortObject loadPortObject(PortObjectZipInputStream in, PortObjectSpec spec, ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {

            FskPortObject portObj = new FskPortObject();

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

  public static void writeFSKObject(FskPortObject fskObj, CombineArchive archive, String filePrefix,
      Map<String, URI> URIS) throws Exception {

    addVersion(archive);
    // Adds model script

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

    private void plotFunction(XYPlot plot, Plotable plotable, String id,
            Color defaultColor, Shape defaultShape, double minX, double maxX)
            throws ConvertException {
        double[][] points = plotable.getFunctionPoints(paramX, paramY, unitX,
                unitY, transformX, transformY, minX, maxX,

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

    private static Map<KnimeTuple, List<KnimeTuple>> getTuplesToCombine(List<KnimeTuple> tuples, boolean containsData) {
        KnimeSchema outSchema = null;

        if (containsData) {
            outSchema = SchemaFactory.createM1DataSchema();

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

    public static void checkRHome(final String rHomePath, final boolean fromPreferences) throws InvalidRHomeException {

        final Path rHome = Paths.get(rHomePath);
        final String msgSuffix = ((fromPreferences) ? ""
                : " R_HOME ('" + rHomePath + "')" + " is meant to be the path to the folder which is the root of R's "

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

    private void createPcData(PCMLDocument pcmlDoc, final PortObject[] inObjects) {
        PCML pcml = pcmlDoc.getPCML();
        ProcessChain pChain = pcml.addNewProcessChain();

        // Fetches model metadata from the 1st table (metadata table)

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

File FskMetaDataTest.java has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 ***************************************************************************************************
 * Copyright (c) 2017 Federal Institute for Risk Assessment (BfR), Germany
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the

File livescript.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE

/**
 * Link to the project's GitHub page:

Method saveSettingsTo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    protected void saveSettingsTo(NodeSettingsWO settings) throws InvalidSettingsException {
        if (!temperatureField.isValueValid()) {
            throw new InvalidSettingsException("Invalid Value");
        }

Method loadSettings has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void loadSettings(NodeSettingsRO settings) {
        try {
            fileName = settings.getString(CFGKEY_FILENAME);
        } catch (InvalidSettingsException e) {
        }

Method checkTables4Id has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private boolean checkTables4Id(Integer stationId)  {
        String sql = "SELECT " + DBKernel.delimitL("Artikelnummer") + "," + DBKernel.delimitL("Bezeichnung") + "," + DBKernel.delimitL("ChargenNr") + "," +
                DBKernel.delimitL("MHD_day") + "," + DBKernel.delimitL("MHD_month") + "," + DBKernel.delimitL("MHD_year") + "," +
                DBKernel.delimitL("pd_day") + "," + DBKernel.delimitL("pd_month") + "," + DBKernel.delimitL("pd_year") + "," +
                DBKernel.delimitL("dd_day") + "," + DBKernel.delimitL("dd_month") + "," + DBKernel.delimitL("dd_year") + "," +
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/actions/PlausibleAction.java - About 2 hrs to fix

Method getPaper has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void getPaper(final int tableID, final String tablename, final String feldname, final int blobID) {
        try {
            ResultSet rs = getResultSet(
                    "SELECT "
                            + DBKernel.delimitL("Dateiname")
Severity: Major
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 2 hrs to fix

Method performExecute has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @Override
  protected PortObject[] performExecute(PortObject[] inObjects, ExecutionContext exec)
      throws Exception {

    if (inObjects[0] != null) {

Method plotFunction has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void plotFunction(XYPlot plot, Plotable plotable, String id,
            Color defaultColor, Shape defaultShape, double minX, double maxX)
            throws ConvertException {
        double[][] points = plotable.getFunctionPoints(paramX, paramY, unitX,
                unitY, transformX, transformY, minX, maxX,
Severity
Category
Status
Source
Language