... | @@ -617,6 +617,74 @@ The response includes the cumulative interest of the project for each version. F |
... | @@ -617,6 +617,74 @@ The response includes the cumulative interest of the project for each version. F |
|
]
|
|
]
|
|
```
|
|
```
|
|
|
|
|
|
|
|
{POST} [`<PROTOCOL>://<IP>:<PORT>/api/sdk4ed/qg/{apache:commons-io}/{release}/{bc47652650729d51f9f5d261270d714f6396df16}`](http://195.251.210.147:8989/api/sdk4ed/qg/apache:commons-io/release/bc47652650729d51f9f5d261270d714f6396df16)
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
{GET} [`<PROTOCOL>://<IP>:<PORT>/api/sdk4ed/refactorings/ruleViolationPrct/{apache:commons-io}`](http://195.251.210.147:8989/api/sdk4ed/refactorings/ruleViolationPrct/apache:commons-io)
|
|
|
|
|
|
|
|
```
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"rank": 1,
|
|
|
|
"rule": "Deprecated code should be removed",
|
|
|
|
"description": "<p>This rule is meant to be used as a way to track code which is marked as being deprecated. Deprecated code should eventually be removed.</p>\n<h2>Noncompliant Code Example</h2>\n<pre>\nclass Foo {\n /**\n * @deprecated\n */\n public void foo() { // Noncompliant\n }\n\n @Deprecated // Noncompliant\n public void bar() {\n }\n\n public void baz() { // Compliant\n }\n}\n</pre>",
|
|
|
|
"language": "java",
|
|
|
|
"value": 0.29177040110650065,
|
|
|
|
"rp": 0.05,
|
|
|
|
"cp": 0.2544951590594744,
|
|
|
|
"issues": [
|
|
|
|
{
|
|
|
|
"file": "src/main/java/org/apache/commons/io/IOUtils.java",
|
|
|
|
"line": "2314",
|
|
|
|
"effort": "10"
|
|
|
|
},
|
|
|
|
...,
|
|
|
|
{
|
|
|
|
"file": "src/main/java/org/apache/commons/io/FileCleaner.java",
|
|
|
|
"line": "116",
|
|
|
|
"effort": "10"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
...,
|
|
|
|
{
|
|
|
|
"rank": 64,
|
|
|
|
"rule": "\"public static\" fields should be constant",
|
|
|
|
"description": "<p>There is no good reason to declare a field \"public\" and \"static\" without also declaring it \"final\". Most of the time this is a kludge to share a\nstate among several objects. But with this approach, any object can do whatever it wants with the shared state, such as setting it to\n<code>null</code>. </p>\n<h2>Noncompliant Code Example</h2>\n<pre>\npublic class Greeter {\n public static Foo foo = new Foo();\n ...\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic class Greeter {\n public static final Foo FOO = new Foo();\n ...\n}\n</pre>\n<h2>See</h2>\n<ul>\n <li> <a href=\"http://cwe.mitre.org/data/definitions/500.html\">MITRE, CWE-500</a> - Public Static Field Not Marked Final </li>\n <li> <a href=\"https://www.securecoding.cert.org/confluence/x/QQBqAQ\">CERT OBJ10-J.</a> - Do not use public static nonfinal fields </li>\n</ul>",
|
|
|
|
"language": "java",
|
|
|
|
"value": 0.0029411764705882353,
|
|
|
|
"rp": 0.0029411764705882353,
|
|
|
|
"cp": 0,
|
|
|
|
"issues": [
|
|
|
|
{
|
|
|
|
"file": "src/main/java/org/apache/commons/io/file/NoopPathVisitor.java",
|
|
|
|
"line": "30",
|
|
|
|
"effort": "20"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"rank": 65,
|
|
|
|
"rule": "Class variable fields should not have public accessibility",
|
|
|
|
"description": "<p>Public class variable fields do not respect the encapsulation principle and has three main disadvantages:</p>\n<ul>\n <li> Additional behavior such as validation cannot be added. </li>\n <li> The internal representation is exposed, and cannot be changed afterwards. </li>\n <li> Member values are subject to change from anywhere in the code and may not meet the programmer's assumptions. </li>\n</ul>\n<p>By using private attributes and accessor methods (set and get), unauthorized modifications are prevented.</p>\n<h2>Noncompliant Code Example</h2>\n<pre>\npublic class MyClass {\n\n public static final int SOME_CONSTANT = 0; // Compliant - constants are not checked\n\n public String firstName; // Noncompliant\n\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\npublic class MyClass {\n\n public static final int SOME_CONSTANT = 0; // Compliant - constants are not checked\n\n private String firstName; // Compliant\n\n public String getFirstName() {\n return firstName;\n }\n\n public void setFirstName(String firstName) {\n this.firstName = firstName;\n }\n\n}\n</pre>\n<h2>Exceptions</h2>\n<p>Because they are not modifiable, this rule ignores <code>public final</code> fields. Also, annotated fields, whatever the annotation(s) will be\nignored, as annotations are often used by injection frameworks, which in exchange require having public fields.</p>\n<h2>See</h2>\n<ul>\n <li> <a href=\"http://cwe.mitre.org/data/definitions/493.html\">MITRE, CWE-493</a> - Critical Public Variable Without Final Modifier </li>\n</ul>",
|
|
|
|
"language": "java",
|
|
|
|
"value": 0.0029411764705882353,
|
|
|
|
"rp": 0.0029411764705882353,
|
|
|
|
"cp": 0,
|
|
|
|
"issues": [
|
|
|
|
{
|
|
|
|
"file": "src/main/java/org/apache/commons/io/file/NoopPathVisitor.java",
|
|
|
|
"line": "30",
|
|
|
|
"effort": "10"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
## Design-Level Refactorings Service
|
|
## Design-Level Refactorings Service
|
|
|
|
|
|
**End Points - URLS**
|
|
**End Points - URLS**
|
... | | ... | |