Skip to content
Sahar Mehrpour edited this page May 24, 2021 · 6 revisions

Are the tags produced by an algorithm or the user input?

The tags are currently defined by users. Users can add new tags in RulePad. The description of the tag can also be updated in the tool. The data is then stored in tagTable.json. E.g., here. Alternatively, tags can be directly added/edited in this file (the data is not yet validated and incorrect formats may break the tool).

Are the rules on the table of contents page provided by the user?

Similar to tags, rules are also provided by the user and displayed in the Table of Contents and other pages (except the Mining Rules page). Users can add new rules or update them in RulePad. The data is then stored in ruleTable.json. E.g., here. Alternatively, rules can be directly added/edited in this file (the data is not yet validated and incorrect formats may break the tool).

How Active Documentation updates its record/display for which rules are being violated?

For each rule, two queries are stored. The first query, quantifier, looks for places in code where the rule must be applied. The second query, constraint, defines how the rule should be applied. That is, the constraint query checks if those code snippets that should follow the rule, also follow the constraints of the rule. For example, consider the following example: “classes that extend command must have an execute method”. Here the rule applies to classes that extend command and these code elements must have execute methods. So, the quantifier query looks for “classes that extend command” and the constraint query looks for “classes that extend command and have execute methods”. The result of the constraint query determines the examples of the rule. The divergence in the results of these two queries determines the violation of the rule. Upon a change in the code, the two queries are run against the updated code, and ActiveDocumentation updates the results.

Clone this wiki locally