Showing 14,752 of 14,752 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- 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 71.
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 checkID
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
private HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkID(Connection conn, boolean before, String dbuuid, KnimeTuple row, Integer oldID, Integer newID,
HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds, String rowuuid) throws PmmException {
- Create a ticketCreate a ticket
Method setSettings
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void setSettings(Config c, Integer defAgent, Integer defMatrix, Double defTemp, Double defPh, Double defAw, Double agentConc, Callable<Void> refresher) throws InvalidSettingsException {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception;
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (!matrixString.isEmpty() || !agentString.isEmpty() || !literatureString.isEmpty() || matrixID > 0 || agentID > 0 || literatureID > 0 || parameter.size() > 0) filterEnabled = true;
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method passesFilter
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
final String matrixString,
final String agentString,
final String literatureString,
int matrixID, int agentID, int literatureID,
final LinkedHashMap<String, Double[]> parameter,
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Method write
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public void write(List<KnimeTuple> tuples, boolean isPMFX, String dir, String mdName, Metadata metadata,
boolean splitModels, String notes, ExecutionContext exec) throws Exception {
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if ((!showOnlyDataFromCurrentUser || v != null && v.containsKey(id)) &&
(id1 < 0 && id2 < 0 || id >= id1 && id <= id2)) {
String toAdd = tn2 + " (ID=" + getFormattedID(id) + "): ";
if (tblname != null) {
toAdd += tblname + " (ID=" + getFormattedID(rs.getInt(2)) + "): ";
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (headerValue != null && mnTable != null && col != null && col > 0 && col - 1 < mnTable.length && mnTable[col - 1] != null && mnTable[col - 1].length() > 0) { // headerValue.toString().equals("Kits")
if (!mnTable[col - 1].equals("INT")) {
String mntname = mnTable[col - 1];
MyTable myMNTable = DBKernel.myDBi.getTable(mntname);
String tname = myT.getTablename();
- Create a ticketCreate a ticket
Method openNewWindow
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public Object openNewWindow(final MyTable theNewTable, final Object value, final Object headerValue, final MyDBTable dbTable, final Integer row, final Integer col, final Object[][] conditions, boolean fromMMC) {
- Create a ticketCreate a ticket
Method insertParam
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
private int insertParam(final int modelId, final String paramName, final int paramType, final Double min, final Double max, final String category, final String unit,
final String description) {
- Create a ticketCreate a ticket
Method insertEstParam
has 8 arguments (exceeds 4 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) {
- Create a ticketCreate a ticket