-
Notifications
You must be signed in to change notification settings - Fork 28
Nature of the Beast Considerations
Dave Nicolette edited this page Feb 1, 2021
·
2 revisions
Home -> Developer Guide -> Implementation Notes ->
Cobol Check is not a compiler; it's a text-processing application that merges files in batch mode. It does not perform lexical analysis of the Cobol source code. It only "knows" that when you read a source file sequentially, you will encounter certain tokens immediately following certain other tokens, possibly depending on which section of the program you're reading at the moment.
This could probably be done in a better way and the design is open to discussion, but it is the present reality. Changing this would involve re-thinking the design at a deep level, and would require more work than typical incremental refactoring to minimize duplication and so forth.
This means:
- Classes Generator and KeywordExtractor will have higher values than we would normally prefer for Cognitive Complexity and Cyclomatic Complexity. Please do refactor for readability, but don't obsess over it in these classes. In these cases, a seemingly-long if/else structure is often easier to follow than a million tiny pieces that call each other. A commmon refactoring like Replace Conditional with Polymorphism could do more harm than good in this context.
- Some functionality can't be checked properly at the unit level, particularly in Generator and Driver. We depend heavily on approval tests to check the behavior of these classes.