Automatically expiring out source code comments
AssigneeInternational Business Machines Corporation
InventorsEli M. Dow, Rachel E. Kohler, Kassidy Martz, Christopher T. Woodlief
Life of this patent
Estimating the term…
Abstract
Aspects include a method for expiring out source code comments. The method includes parsing source code to locate one or more comments. The method also includes, for each of the located one or more comments: determining whether the comment specifies expiration criteria; determining whether the expiration criteria meets an expiration threshold based on the comment specifying expiration criteria; and deleting the comment from the source code based on determining that the expiration criteria meets the expiration threshold, the deleting resulting in updated source code. The method further includes storing the updated source code.
Claims8
A system for expiring out source code comments, the system comprising:
- a memory having computer readable instructions;
- and
- one or more processors for executing the computer readable instructions, the computer readable instructions comprising:
- parsing source code to locate one or more comments;
- performing, for each of the one or more comments:
- determining whether the comment specifies expiration criteria, wherein the expiration criteria specifies a version number of the source code at the time that the comment was added to the edited source code and an integrated development environment (IDE) phase in process at the time that the comment was added to the edited source code;
- based on the comment specifying expiration criteria:
- determining whether the expiration criteria meets an expiration threshold, wherein the expiration threshold specifies that any comments added to the source code prior to a particular version number should be deleted and that any comments added to the edited source code prior to a particular IDE phase should be deleted;
- and
- deleting the comment from the source code based on determining that the expiration criteria meets the expiration threshold, the deleting resulting in updated source code;
- and
- storing the updated source code.
A computer program product for expiring out source code comments, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform:
- parsing source code to locate one or more comments;
- performing, for each of the one or more comments:
- determining whether the comment specifies expiration criteria, wherein the expiration criteria specifies a version number of the source code at the time that the comment was added to the edited source code and an integrated development environment (IDE) phase in process at the time that the comment was added to the edited source code;
- based on the comment specifying expiration criteria:
- determining whether the expiration criteria meets an expiration threshold, wherein the expiration threshold specifies that any comments added to the source code prior to a particular version number should be deleted and that any comments added to the edited source code prior to a particular IDE phase should be deleted;
- and
- deleting the comment from the source code based on determining that the expiration criteria meets the expiration threshold, the deleting resulting in updated source code;
- and
- storing the updated source code.
Dependencies are inferred from the claim text.