File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/sql/constraint/TableConstraints.java | File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/sql/constraint/TableConstraints.java | |||
Method name: List
|
Method name: List
|
|||
Number of AST nodes: 8 | Number of AST nodes: 6 | |||
1 | ArrayList<DefaultConstraint> results = ↵ | 1 | ArrayList<PrimaryKeyConstraint> results = ↵ | |
2 | new ArrayList<DefaultConstraint>();↵ | 2 | new ArrayList<PrimaryKeyConstraint>();↵ | |
3 | for (int i = 0; i < _constraints.size(); i++) {↵ | 3 | for (int i = 0; i < _constraints.size(); i++) {↵ | |
4 | MssqlConstraint constraint = _constraints.get(i);↵ | 4 | MssqlConstraint constraint = _constraints.get(i);↵ | |
5 | if (constraint instanceof DefaultConstraint) {↵ | 5 | if (constraint instanceof PrimaryKeyConstraint) {↵ | |
6 | DefaultConstraint def = (DefaultConstraint) constraint;↵ | 6 | results.add((PrimaryKeyConstraint)constraint↵ | |
7 | if (def.constrainsColumn(columnName))↵ | |||
8 | results.add(def);↵ | 7 | );↵ | |
9 | }↵ | 8 | }↵ | |
10 | }↵ | 9 | }↵ | |
11 | return results; | 10 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | DefaultConstraint def = (DefaultConstraint)constraint; |
| 3 | MssqlConstraint constraint = _constraints.get(i); | ||||||||||||||||||||||
6 | if (def.constrainsColumn(columnName)) |
| 4 | if (constraint instanceof PrimaryKeyConstraint) | ||||||||||||||||||||||
7 | results.add(def); |
| 5 | results.add((PrimaryKeyConstraint)constraint); |
Row | Violation |
---|---|
1 | Expression def.constrainsColumn(columnName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression constraint instanceof PrimaryKeyConstraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression def cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression (PrimaryKeyConstraint)constraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression def cannot be unified with expression (PrimaryKeyConstraint)constraint , because common superclass type net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.MssqlConstraint cannot be passed as an argument to public boolean add(net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.DefaultConstraint) |