Method instantiateEncoding
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void instantiateEncoding(int m, int freeVariables,
ArrayList<VisualTransformableNode> scenarios, Variable[] vars,
boolean[][] encoding, int pr, HashMap<String, Integer> events,
VisualVertex[] vertices, VisualCpog cpog, VisualScenario resultCpog,
ArrayList<Point2D> positions, ArrayList<Integer> count,
Method resetVars
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void resetVars(String verbose, String genMode, String numSol, String customFlag, String customPath, String effort, String espressoFlag, String abcFlag, String gateLibFlag, String cpogSize, String disableFunction, String oldSynt) {
Method connectFormulaeToVisualVertex
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void connectFormulaeToVisualVertex(int v, int a, Variable[] vars, HashMap<String,
BooleanFormula> formulaeName, String[] optFormulaeVertices, String[] optVertices,
String[] optFormulaeArcs, String[] arcNames) throws ParseException {
Method constructConstraints
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
protected ArrayList<String> constructConstraints(char[][][] constraints, int[][] graph, int m, int n,
ArrayList<VisualTransformableNode> scenarios,
HashMap<String, Integer> events, ArrayList<Point2D> positions,
ArrayList<Integer> count) {
Avoid deeply nested control flow statements. Open
for (int j = 0; j < n; j++) {
if (graph[t][j] > 0) graph[i][j] = 1;
}
Avoid deeply nested control flow statements. Open
if (constraints[k][i][i] == '0' || constraints[k][j][j] == '0') ch = '-';
Avoid deeply nested control flow statements. Open
for (int i = 0; i < result.length(); i++) {
if (result.charAt(i) == '(') {
end += ')';
} else if (result.charAt(i) == ')') {
end += '(';
Avoid deeply nested control flow statements. Open
if (graph[i][j] > 1) ch = '-';
Avoid deeply nested control flow statements. Open
for (int i = end.length() - 1; i >= 0; i--) {
output.print(end.charAt(i));
}
Method buildCpog
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected void buildCpog(int n, int m, char[][][] constraints,
VisualCpog cpog, VisualVertex[] vertices, HashMap<String,
BooleanFormula> formulaeName) {
Avoid deeply nested control flow statements. Open
for (int j = 0; j < n; j++) {
if (graph[t][j] > 0) graph[i][j] = 2;
}
Avoid deeply nested control flow statements. Open
if (graph[i][j] > 0) ch = '1';
Avoid deeply nested control flow statements. Open
for (int i = 0; i < cond.length(); i++) {
if (SPECIAL_SYMBOLS.indexOf(cond.charAt(i)) < 0) {
tmp = "";
while ((i < cond.length()) && (SPECIAL_SYMBOLS.indexOf(cond.charAt(i)) < 0)) {
tmp += cond.charAt(i);
Method scanScenarios
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected int scanScenarios(int m, ArrayList<VisualTransformableNode> scenarios,
HashMap<String, Integer> events, ArrayList<Point2D> positions,
ArrayList<Integer> count) {
Method writeCpogIntoFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected int writeCpogIntoFile(int m, ArrayList<VisualTransformableNode> scenarios,
File scenarioFile, File encodingFile, EncoderSettings settings) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
for (int i = 0; i < freeVariables; i++) {
if (scenarios.get(k) instanceof VisualScenario) {
VisualScenario scenario = (VisualScenario) scenarios.get(k);
scenario.getEncoding().setState(vars[i], VariableState.fromBoolean(encoding[k][i]));
} else if (scenarios.get(k) instanceof VisualScenarioPage) {
- Read upRead up
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 110.
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
for (int t = 0; t < n; t++) {
for (int i = 0; i < n; i++) {
if (graph[i][t] > 0) {
for (int j = 0; j < n; j++) {
if (graph[t][j] > 0) graph[i][j] = 1;
- Read upRead up
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 110.
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
for (int t = 0; t < n; t++) {
for (int i = 0; i < n; i++) {
if (graph[i][t] > 0) {
for (int j = 0; j < n; j++) {
if (graph[t][j] > 0) graph[i][j] = 2;
- Read upRead up
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 110.
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
for (int i = freeVariables; i < freeVariables + pr; i++) {
if (scenarios.get(k) instanceof VisualScenario) {
VisualScenario scenario = (VisualScenario) scenarios.get(k);
scenario.getEncoding().setState(vars[i], VariableState.fromBoolean(encoding[k][i]));
} else if (scenarios.get(k) instanceof VisualScenarioPage) {
- Read upRead up
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 110.
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
for (int i = 0; i < v; i++) {
if (optFormulaeVertices[i].contains("x")) {
BooleanFormula formulaOpt = null;
formulaOpt = BooleanFormulaParser.parse(optFormulaeVertices[i], name -> nameToVar(name, vars));
formulaeName.put(optVertices[i], formulaOpt);
- Read upRead up
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 82.
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
for (int i = 0; i < a; i++) {
if (optFormulaeArcs[i].contains("x")) {
BooleanFormula formulaOpt = null;
formulaOpt = BooleanFormulaParser.parse(optFormulaeArcs[i], name -> nameToVar(name, vars));
formulaeName.put(arcNames[i], formulaOpt);
- Read upRead up
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 82.
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
if (constraints[k][event1][event2] == '0') {
if (trivial == '1') return '?';
trivial = '0';
}
- Read upRead up
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 42.
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
if (constraints[k][event1][event2] == '1') {
if (trivial == '0') return '?';
trivial = '1';
}
- Read upRead up
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 42.
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