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) {
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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));
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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");
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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));
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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");
- Read upRead up
- Create a ticketCreate a ticket
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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");
- Create a ticketCreate a ticket
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();
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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();
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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));
- Create a ticketCreate a ticket
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<>();
- Create a ticketCreate a ticket
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) {
- Create a ticketCreate a ticket
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 = "";
- Create a ticketCreate a ticket
Method fileChanged
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void fileChanged(FilePanel source) {
set.setFileName(filePanel.getFileName());
try {
- Create a ticketCreate a ticket
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 {
- Create a ticketCreate a ticket
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")) {
- Create a ticketCreate a ticket
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) {
- Create a ticketCreate a ticket
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 {
- Create a ticketCreate a ticket
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();
- Create a ticketCreate a ticket