M
moi
Hello,
what tool provide an help to transform copies of source code into calls
to one common method in java?
Example:
* original
public void drawCellSmooth(int w, int h) {
if (w < 3 || h < 3)
return;
...
}
public void drawCellNormal(int w, int h) {
if (w < 3 || h < 3)
return;
...
}
* result
private boolean checkWidthHeight(int w, int h) {
return (w < 3 || h < 3);
}
public void drawCellSmooth(int w, int h) {
if (checkWidthHeight(w, h))
return;
...
}
public void drawCellNormal(int w, int h) {
if (checkWidthHeight(w, h))
return;
...
}
Other features are searched:
* detection of all the similar number to transform them into constants
* detection of same source code
* detection of almost same source code
- variable name are different
- the code is not exactly the same
* similar class which should be integrated into a hirarchy
* etc...
Any help appreciated
what tool provide an help to transform copies of source code into calls
to one common method in java?
Example:
* original
public void drawCellSmooth(int w, int h) {
if (w < 3 || h < 3)
return;
...
}
public void drawCellNormal(int w, int h) {
if (w < 3 || h < 3)
return;
...
}
* result
private boolean checkWidthHeight(int w, int h) {
return (w < 3 || h < 3);
}
public void drawCellSmooth(int w, int h) {
if (checkWidthHeight(w, h))
return;
...
}
public void drawCellNormal(int w, int h) {
if (checkWidthHeight(w, h))
return;
...
}
Other features are searched:
* detection of all the similar number to transform them into constants
* detection of same source code
* detection of almost same source code
- variable name are different
- the code is not exactly the same
* similar class which should be integrated into a hirarchy
* etc...
Any help appreciated