Editing Code Cleanup
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
Our tried and true [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING?revision=HEAD developer guidelines HACKING file] identifies numerous stylistic concerns and source code conventions that the entire BRL-CAD source code should conform to. When in doubt, consult the dev guidelines. | Our tried and true [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING?revision=HEAD developer guidelines HACKING file] identifies numerous stylistic concerns and source code conventions that the entire BRL-CAD source code should conform to. When in doubt, consult the dev guidelines. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 19: | Line 14: | ||
#!/bin/sh | #!/bin/sh | ||
− | files=`find . \( -name \*.h | + | export files=`find . \( -name \*.h |
− | -o -name \*.c | + | -o -name \*.c |
− | -o -name \*.cxx | + | -o -name \*.cxx |
− | -o -name \*.cpp | + | -o -name \*.cpp |
− | -o -name \*.tcl | + | -o -name \*.tcl |
− | -o -name \*.itcl | + | -o -name \*.itcl |
− | -o -name \*.itk | + | -o -name \*.itk |
− | -o -name \*.tk \) | + | -o -name \*.tk \) |
− | -not -regex '.*src/other.*' | + | -not -regex '.*src/other.*' |
− | -not -regex '.*misc.*' | + | -not -regex '.*misc.*' |
− | -not -regex '.*libfft.*' | + | -not -regex '.*libfft.*' |
− | -not -regex '.*src/mged/points/.*' | + | -not -regex '.*src/mged/points/.*' |
-not -regex '.*src/tab/.*'` | -not -regex '.*src/tab/.*'` | ||
java -Xms200m -Xmx2000m -jar simian-2.2.24.jar -threshold=25 $files | java -Xms200m -Xmx2000m -jar simian-2.2.24.jar -threshold=25 $files | ||
Line 39: | Line 34: | ||
Copyright (c) 2003-08 RedHill Consulting Pty. Ltd. All rights reserved. | Copyright (c) 2003-08 RedHill Consulting Pty. Ltd. All rights reserved. | ||
Simian is not free unless used solely for non-commercial or evaluation purposes. | Simian is not free unless used solely for non-commercial or evaluation purposes. | ||
− | {failOnDuplication=true, ignoreCharacterCase=true, ignoreCurlyBraces=true, ignoreIdentifierCase=true, | + | {failOnDuplication=true, ignoreCharacterCase=true, ignoreCurlyBraces=true, ignoreIdentifierCase=true, ignoreModifiers=true, ignoreStringCase=true, threshold=6} |
− | |||
Found 10 duplicate lines in the following files: | Found 10 duplicate lines in the following files: | ||
Between lines 472 and 485 in /Users/morrison/brlcad/src/libged/wdb_nirt.c | Between lines 472 and 485 in /Users/morrison/brlcad/src/libged/wdb_nirt.c | ||
Line 58: | Line 52: | ||
Processing time: 22.329sec | Processing time: 22.329sec | ||
− | Once you get the output report, focus attention on refactoring the largest or most frequently duplicated code into reusable functions | + | Once you get the output report, focus attention on refactoring the largest or most frequently duplicated code into reusable functions. Submit patches or commit changes accordingly. |
=Coverity Scan= | =Coverity Scan= | ||
Line 78: | Line 72: | ||
We'll probably have you fix an issue or two first to make sure you're serious. | We'll probably have you fix an issue or two first to make sure you're serious. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |