Showing 14,752 of 14,752 total issues
Method createTable
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public void createTable() {
String fieldDefs = DBKernel.delimitL("ID") + " INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY";
if (tableName.equals("ChangeLog")) {
fieldDefs = DBKernel.delimitL("ID") + " INTEGER GENERATED BY DEFAULT AS SEQUENCE " + DBKernel.delimitL("ChangeLogSEQ") + " PRIMARY KEY";
}
- Read upRead up
- Create a ticketCreate a ticket
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 updateEstModel
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private void updateEstModel(final int estModelId, String name, final int condId, final int modelId, final double rms, final double rsquared, final double aic,
final double bic, final int responseId, Integer qualityScore, Boolean isChecked, Integer workflowID, String comment) {
try {
PreparedStatement ps = conn.prepareStatement("UPDATE \"GeschaetzteModelle\" SET \"Name\"=?, \"Versuchsbedingung\"=?, \"Modell\"=?, \"RMS\"=?, \"Rsquared\"=?, \"AIC\"=?, \"BIC\"=?, \"Response\"=?, \"Guetescore\"=?, \"Geprueft\"=?, \"Kommentar\"=?, \"PMMLabWF\"=? WHERE \"ID\"=?");
if (name == null) {
- Read upRead up
- Create a ticketCreate a ticket
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 applyJoinRelation
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public void applyJoinRelation(FskPortObject fskObj, List<JoinRelationAdvanced> joinRelationList,
String suffix) throws Exception {
// figure out which parameters from JoinRelations belong to which model to avoid loading
// a json file twice
- Read upRead up
- Create a ticketCreate a ticket
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 revertFormula
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public String revertFormula() {
String result = formula;
if (depXml != null && !depXml.name.equals(depXml.origName)) {
result = MathUtilities.replaceVariable(result, depXml.name, depXml.origName);
}
- Read upRead up
- Create a ticketCreate a ticket
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 actionPerformed
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okButton) {
approved = true;
selection = new ArrayList<>();
- Read upRead up
- Create a ticketCreate a ticket
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 setValue
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private void setValue(final int i, final Object obj) throws PmmException {
if (obj == null)
cell[i] = CellIO.createMissingCell();
else
switch (schema.getType(i)) {
- Read upRead up
- Create a ticketCreate a ticket
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 checkUnits
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private static void checkUnits(Object[] toksT, Object[] toksLu) {
try {
if (toksLu != null && toksLu.length > 0) {
String unit = toksLu[0].toString();
int i=1;
- Read upRead up
- Create a ticketCreate a ticket
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 _getModelHandler
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
async _getModelHandler ( modelMetadata, modelId ) {
let O = this;
_log( 'MODAL DETAILS / _getModelHandler' );
let modelHandler = null;
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
private HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkIDs(Connection conn, boolean before, String dbuuid, KnimeTuple row, ParametricModel pm,
HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds, String[] schemaAttr, String[] dbTablename, String rowuuid, boolean checkAnywayDueToNegativeId)
throws PmmException {
if (checkAnywayDueToNegativeId || rowuuid == null || !rowuuid.equals(dbuuid)) {
if (!foreignDbIds.containsKey(rowuuid)) foreignDbIds.put(rowuuid, new HashMap<String, HashMap<Integer, Integer>>());
- 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 215.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
private HashMap<String, HashMap<String, HashMap<Integer, Integer>>> checkIDs(Connection conn, boolean before, String dbuuid, KnimeTuple row, ParametricModel pm,
HashMap<String, HashMap<String, HashMap<Integer, Integer>>> foreignDbIds, String[] schemaAttr, String[] dbTablename, String rowuuid, boolean checkAnywayDueToNegativeId)
throws PmmException {
if (checkAnywayDueToNegativeId || rowuuid == null || !rowuuid.equals(dbuuid)) {
if (!foreignDbIds.containsKey(rowuuid)) foreignDbIds.put(rowuuid, new HashMap<String, HashMap<Integer, Integer>>());
- 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 215.
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 retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public OtherModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
OtherModelGeneralInformation information = new OtherModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public GenericModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
GenericModelGeneralInformation information = new GenericModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(I);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public DoseResponseModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
DoseResponseModelGeneralInformation information = new DoseResponseModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(I);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(I);
- Create a ticketCreate a ticket
Method retrieveGeneralInformation
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public PredictiveModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {
PredictiveModelGeneralInformation information = new PredictiveModelGeneralInformation();
Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(I);
- Create a ticketCreate a ticket