SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    public String getElementName() {
        String name = "";
        if (type == Type.MD) {
            name = "mdMatrix";
        } else if (type == Type.Model1) {
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/extendedtable/items/AgentXml.java on lines 94..105
de.bund.bfr.knime.pmm.common/src/de/bund/bfr/knime/pmm/extendedtable/items/LiteratureItem.java on lines 157..168

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    static void compare(Misc obtained, Misc expected) {
        assertThat(obtained.id, equalTo(expected.id));
        assertThat(obtained.name, equalTo(expected.name));
        assertThat(obtained.description, equalTo(expected.description));
        assertThat(obtained.value, equalTo(expected.value));
de.bund.bfr.knime.pmm.nodes.tests/src/de/bund/bfr/knime/pmm/js/common/TestUtils.java on lines 87..93

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  @Test
  public void testMakeIndividualSimulation_CombinedSim_ShouldReturnSecondPresent() {
    FskSimulation fskSimulation = new FskSimulation("sim");

    fskSimulation.getParameters().put("out112", "1");
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/JoinerNodeUtilTest.java on lines 37..48

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    static void compare(MdInfo obtained, MdInfo expected) {
        assertThat(obtained.id, equalTo(expected.id));
        assertThat(obtained.name, equalTo(expected.name));
        assertThat(obtained.comment, equalTo(expected.comment));
        assertThat(obtained.qualityScore, equalTo(expected.qualityScore));
de.bund.bfr.knime.pmm.nodes.tests/src/de/bund/bfr/knime/pmm/js/common/TestUtils.java on lines 95..101

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  @Test
  public void testMakeIndividualSimulation_CombinedSim_ShouldReturnFirstEmpty() {
    FskSimulation fskSimulation = new FskSimulation("sim");

    fskSimulation.getParameters().put("out112", "1");
de.bund.bfr.knime.fsklab.nodes.tests/src/de/bund/bfr/knime/fsklab/nodes/JoinerNodeUtilTest.java on lines 50..61

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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) {

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

    private Integer copyRow(final ResultSet rs, final String tablename, final String parentTable, final Integer parentID) {
        Integer result = null;
        try {
            String columns = "";
            String vals = "";
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/gui/dbtable/MyDBTable.java - About 1 hr to fix

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

    @Override
    public void fileChanged(FilePanel source) {
        set.setFileName(filePanel.getFileName());

        try {

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

    private String getForeignVal(final String tablename, final int id, final String fields) {
        String result = "";
        String sql= "SELECT " + fields + " FROM " + DBKernel.delimitL(tablename) + " WHERE " + DBKernel.delimitL("ID") + "=" + id;
        ResultSet rs = DBKernel.getResultSet(sql, false);
        try {

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

    private Double manageDouble(PreparedStatement ps, PreparedStatement psUpdate, int lfdCol, HSSFCell cell) throws SQLException {
        Double dbl = null;
        if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
        } else if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
            if (cell.getStringCellValue().trim().length() > 0 && !cell.getStringCellValue().equalsIgnoreCase("null")) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 1 hr to fix

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

    private Date manageDate(PreparedStatement ps, PreparedStatement psUpdate, int lfdCol, HSSFCell cell) throws SQLException {
        Date result = null;
        if (cell == null || cell.getCellType() == HSSFCell.CELL_TYPE_BLANK) {
        } else if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
            if (cell.getStringCellValue().trim().length() > 0) {
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/imports/GeneralXLSImporter.java - About 1 hr to fix

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

    private HashMap<String, Integer> loadNodeIDs10000() {
        System.err.println("loadNodeIDs10000...");

        nodeIds = new HashMap<String, Integer>();
        try {

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

    public static boolean sendRequest(Connection conn, final String sql, final boolean suppressWarnings, final boolean fetchAdminInCase) {
        boolean result = false;
        boolean adminGathered = false;
        try {
            if (conn == null || conn.isClosed()) conn = getDBConnection();
Severity: Minor
Found in org.hsh.bfr.db/src/org/hsh/bfr/db/DBKernel.java - About 1 hr to fix
Severity
Category
Status
Source
Language