Use the tool Simian for redundant code detection and processing. How to use: First download the latest version and unzip the file; then add the path where simian is located to the windows environment variable path; then add [simian-2.2.24 .exe] file name to [simian.exe] and run it.
Redundant code detection and processing tool Simian,Usage:
Go to Download the latest version from the official website. After downloading, unzip the file and add the path where simian is located to the windows environment variable path. At the same time, change the file name of simian-2.2.24.exe to simian.exe, which is convenient For our use, simian is a command line tool. Just run simian in cmd:
c:\>simian.exe [options] files
The specific usage method is introduced below:
Check all c# files including subdirectories:
"-includes=*.cs"
Check all c# files in the current directory, and only check the code with more than 3 lines of duplicate code
-threshold=3 "*.cs"
Check all c# files:
"*.cs"
If you use the command line output , it is not very convenient to locate the code, you can use the external tool of Visual Studio
If you want to learn more about programming, please pay attention to thephp trainingcolumn!
The above is the detailed content of What tools are used to detect and deal with redundant code?. For more information, please follow other related articles on the PHP Chinese website!