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: 4 | Number of AST nodes: 4 | |||
1 | for (int i = 0; i < _constraints.size(); i++) {↵ | 1 | for (int i = 0; i < _constraints.size(); i++) {↵ | |
2 | MssqlConstraint constraint = _constraints.get(i);↵ | 2 | MssqlConstraint constraint = _constraints.get(i);↵ | |
3 | if (constraint instanceof PrimaryKeyConstraint) {↵ | 3 | if (constraint instanceof CheckConstraint) {↵ | |
4 | results.add((PrimaryKeyConstraint)constraint);↵ | 4 | results.add((CheckConstraint)constraint);↵ | |
5 | }↵ | 5 | }↵ | |
6 | } | 6 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 4 |
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) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | for (int i = 0; i < _constraints.size(); i++) | 2 | for (int i = 0; i < _constraints.size(); i++) | ||||||||||||||
3 | MssqlConstraint constraint = _constraints.get(i); | 3 | MssqlConstraint constraint = _constraints.get(i); | ||||||||||||||
4 | if (constraint instanceof PrimaryKeyConstraint) |
| 4 | if (constraint instanceof CheckConstraint) | |||||||||||||
5 | results.add((PrimaryKeyConstraint)constraint); |
| 5 | results.add((CheckConstraint)constraint); |
Row | Violation |
---|---|
1 | Expression constraint instanceof PrimaryKeyConstraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression constraint instanceof CheckConstraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression (PrimaryKeyConstraint)constraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression (CheckConstraint)constraint cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression (PrimaryKeyConstraint)constraint cannot be unified with expression (CheckConstraint)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.PrimaryKeyConstraint) |