Renaming Suggestion of Method Names to Make Them More Descriptive
Description
As one of the most important types of identifiers, method names play an essential role in program comprehension and maintenance. As a result, method names should be clear, concise, and descriptive of the functionality of method bodies.
To identify non-descriptive method names, we have developed a DL-based tool named NameSpotter, and we would like to help you with identifying non-descriptive method names in your projects.
We inspect all the Java method names in your project and find that the majority of them are descriptive enough to deliver the functionality of the corresponding bodies. However, there are still some method names that NameSpotter considered non-descriptive.
Here we give an example of non-descriptive method names in your projects:
NameSpotter considered "p" as non-descriptive because it is ambiguous and unclear, and we proposed renaming the method name to "print". If this case is trivial and of little importance, here we have detected another non-descriptive method name:
/* Non-descriptive Method Names in jonix/src/main/java/com/tectonica/jonix/JonixSource.java */
public String sourceName() {
return file != null ? file.getAbsolutePath() : stream.toString();
}
NameSpotter considered "sourceName" as non-descriptive because it lacks a verb that indicates the action of this method. Furthermore, "source" is kind of generic, and “source” actually indicates a file. We proposed renaming the method name to "getAbsoluteFilePath".
The relevant modification has been submitted as a PR, and thanks for your precious time to consider it soon.
Renaming Suggestion of Method Names to Make Them More Descriptive
Description
As one of the most important types of identifiers, method names play an essential role in program comprehension and maintenance. As a result, method names should be clear, concise, and descriptive of the functionality of method bodies.
To identify non-descriptive method names, we have developed a DL-based tool named NameSpotter, and we would like to help you with identifying non-descriptive method names in your projects.
We inspect all the Java method names in your project and find that the majority of them are descriptive enough to deliver the functionality of the corresponding bodies. However, there are still some method names that NameSpotter considered non-descriptive. Here we give an example of non-descriptive method names in your projects:
NameSpotter considered "p" as non-descriptive because it is ambiguous and unclear, and we proposed renaming the method name to "print". If this case is trivial and of little importance, here we have detected another non-descriptive method name:
NameSpotter considered "sourceName" as non-descriptive because it lacks a verb that indicates the action of this method. Furthermore, "source" is kind of generic, and “source” actually indicates a file. We proposed renaming the method name to "getAbsoluteFilePath". The relevant modification has been submitted as a PR, and thanks for your precious time to consider it soon.