PMD Source Code Reading (3) — Rule Checking
PMD uses built-in coding rules to perform static checks on the code. It obtains the abstract syntax tree (AST) of the code through JavaCC and JJTree, and then checks the nodes of the syntax tree.
PMD uses built-in coding rules to perform static checks on the code. It obtains the abstract syntax tree (AST) of the code through JavaCC and JJTree, and then checks the nodes of the syntax tree.
This article introduces the principles of CPD code copy-paste detection, a method that can be used for detecting copy-pasting in any text.
During this period, I have been working on code analysis, so I want to understand the principles of related tools. PMD is a Java static code analysis tool that mainly includes two parts: duplicate code detection and code rule checking.
The best time to plant a tree was ten years ago. The second best time is now.