Home  >  Article  >  What tools are used to detect and deal with redundant code?

What tools are used to detect and deal with redundant code?

coldplay.xixi
coldplay.xixiOriginal
2020-08-29 09:21:253540browse

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.

What tools are used to detect and deal with redundant code?

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 the php training column!

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn