File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/util/MssqlIntrospector.java | File path: /sql12/plugins/mssql/src/net/sourceforge/squirrel_sql/plugins/mssql/util/MssqlIntrospector.java | |||
Method name: TableConstraints getTableConstraints(IDatabaseObjectInfo, ISQLConnection)
|
Method name: TableConstraints getTableConstraints(IDatabaseObjectInfo, ISQLConnection)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | CheckConstraint check = new CheckConstraint();↵ | 1 | DefaultConstraint def = new DefaultConstraint();↵ | |
2 | String col = constraintType.substring(16).trim(); // chop off "CHECK on column ";↵ | 2 | String col = constraintType.substring(18).trim(); // chop off "DEFAULT on column ";↵ | |
3 | check.setConstraintName(constraintName);↵ | 3 | def.setConstraintName(constraintName);↵ | |
4 | check.addConstraintColumn(col);↵ | 4 | def.addConstraintColumn(col);↵ | |
5 | check.setCheckExpression(constraintKeys);↵ | 5 | def.setDefaultExpression(constraintKeys);↵ | |
6 | constraints.addConstraint(check); | 6 | constraints.addConstraint(def); | |
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.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 19 |
Number of mapped statements | 6 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22 | CheckConstraint check = new CheckConstraint(); |
| 15 | DefaultConstraint def = new DefaultConstraint(); | |||||||||||||||||||||
23 | String col = constraintType.substring(16).trim(); |
| 16 | String col = constraintType.substring(18).trim(); | |||||||||||||||||||||
24 | check.setConstraintName(constraintName); |
| 17 | def.setConstraintName(constraintName); | |||||||||||||||||||||
25 | check.addConstraintColumn(col); |
| 18 | def.addConstraintColumn(col); | |||||||||||||||||||||
26 | check.setCheckExpression(constraintKeys); |
| 19 | def.setDefaultExpression(constraintKeys); | |||||||||||||||||||||
27 | constraints.addConstraint(check); |
| 20 | constraints.addConstraint(def); |
Row | Violation |
---|---|
1 | Expression check.setCheckExpression(constraintKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression def.setDefaultExpression(constraintKeys) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression check.setCheckExpression(constraintKeys) is a void method call, and thus it cannot be parameterized |
4 | Expression def.setDefaultExpression(constraintKeys) is a void method call, and thus it cannot be parameterized |
5 | Expression check cannot be unified with expression def , because common superclass net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.MssqlConstraint does not declare member(s) public void setCheckExpression(java.lang.String) , public void setDefaultExpression(java.lang.String) |