Browse Prior Art Database

Statistical Analysis on Code Format Disclosure Number: IPCOM000239666D
Publication Date: 2014-Nov-24
Document File: 2 page(s) / 199K

Publishing Venue

The Prior Art Database


Disclosed is a method to run a format analysis on a code base to identify common practices and then automatically create and apply a template.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 01 of 2

Statistical Analysis on Code Format

Because of different conventions, or the lack of convention, used by individual developers, code can be non-uniform and difficult to read. This makes new code especially difficult for developers to understand because both new logic and new formatting are introduced. All developers have slightly different preferences when it comes to writing code. For example, placement of white space and methods for naming variables are small differences that rarely affect the flow of the program ; however, such elements can improve readability and provide uniformity across and entire system. Currently, templates can be applied to code that reformats code to conform to the template's defined standards. Custom templates can also be created to do the same. Most development environments support templates and template creation.

The novel contribution is a method to run a format analysis on a code base to identify common practices and automatically create and apply a template. This allows all developers that work with the code base to work with the same format, and it is in a format that the team has identified to be most readable. This can improve the speed at which developers understand new code. This also provides structure as a code base expands. New projects or features can be automatically formatted to resemble legacy code, thus reducing the maintenance effort in terms of code readability . Templates created by the format analysis can also be altered to use preferred formatting styles.

The following are some example cases of where this could be helpful:

Variable naming conventions: detect the use of camel case and normalize all variable names to use it, but constants are all capitals with underscores between words

Different templates for different languages: if multiple langu...