... | ... | @@ -497,4 +497,122 @@ The response includes the cumulative interest of the project for each version. F |
|
|
|
|
|
## Design-Level Refactorings Service
|
|
|
|
|
|
**End Points - URLS**
|
|
|
|
|
|
{GET} http://195.251.210.147:7070/extractMethodOpportunities/search?projectID=
|
|
|
|
|
|
{GET} http://195.251.210.147:7070/moveClassRefactorings/search?projectID=&isNew=
|
|
|
|
|
|
|
|
|
| Parameter | Description | Required | Type |Notes |
|
|
|
|:------------:|:---------------------------------------------------------------:|:--------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
| projectID | The name of the project. The name should be the same as the name that given through the analysis phase. | Yes | String |
|
|
|
| isNew | This parameter takes 2 values, 0 and 1. 0 represents the initial code design and 1 refers to the proposed code design. | yes for the second URL | Boolean |
|
|
|
|
|
|
**Extract Method Opportunities**
|
|
|
|
|
|
Returns extract method opportunities, the name of the method, the start line to start the extraction and the end line.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
|
|
In this example, we want to retrieve the extract method opportunities for the project with ID ‘Neurasmus’. Same output for java and c projects.
|
|
|
|
|
|
{GET} http://195.251.210.147:7070/extractMethodOpportunities/search?projectID=Neurasmus
|
|
|
|
|
|
Headers: -
|
|
|
|
|
|
Authorization: -
|
|
|
|
|
|
**Response**
|
|
|
|
|
|
An array with all the opportunities.
|
|
|
```
|
|
|
{
|
|
|
"opportunities":[
|
|
|
{
|
|
|
“name":"imdcode.c:main(void))
|
|
|
Line Start: 200<br> Line End: 270",
|
|
|
"colorValue":1990,
|
|
|
"value":77
|
|
|
},
|
|
|
{
|
|
|
|
|
|
"name":"sisc.cpp:sisc()<br>
|
|
|
Line Start: 112<br> Line End: 208",
|
|
|
"colorValue":4658,
|
|
|
"value":126
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
|
|
|
**Move Class Refactorings**
|
|
|
|
|
|
Returns a tree structure that presents the packages and the files inside them based on coupling and cohesion.
|
|
|
|
|
|
**Sample Request**
|
|
|
|
|
|
In this example, we want to retrieve the extract method opportunities for the project with ID ‘Neurasmus’ and isNew ‘1’, which means, the proposed code design architecture. Same output for java and c projects.
|
|
|
|
|
|
{GET} http://195.251.210.147:7070/moveClassRefactorings/search?projectID=Neurasmus&isNew=1
|
|
|
|
|
|
Headers: -
|
|
|
|
|
|
Authorization: -
|
|
|
|
|
|
**Response**
|
|
|
|
|
|
A tree structure with the proposed or initial code design architecture.
|
|
|
```
|
|
|
{
|
|
|
"moveClassRefactorings":{
|
|
|
"name":"root",
|
|
|
"toggled":true,
|
|
|
"children":[
|
|
|
{
|
|
|
"name":"1",
|
|
|
"children":[
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.misty1"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.sec_primitives"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.reader"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.resources.imdcode"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.resources.imdcode_v1.3.misty1"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.resources.imdcode_v1.3.imdcode"
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
"name":"2",
|
|
|
"children":[
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.sims"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.api"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.sisc"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.body"
|
|
|
},
|
|
|
{
|
|
|
"name":"Neurasmus8.imd-emulator.main"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
``` |
|
|
\ No newline at end of file |