Question

We have a large app (40,000+ lines of comments alone) that we are handing over to another company but need to make sure our code comments are kosher. My plan of finding inappropriate code comments is as follows... 1 - obtain a black list of profane words 2 - use a regular expression in eclispe's code search to see if any of those words are in our app, and manually examine each case.

For item # 1, I've seen some applications or web services that do filtering, but does anyone know of a simple list of words somewhere online?

For item # 2, how do I simply search in eclispe for say the words hamburger OR pizza?

Était-ce utile?

La solution 3

The simple and correct answer to this is as follows... in Eclipse you can run a regex to match words by simply checking the regular expression button and piping your words as so pizza | hamburger.

Autres conseils

Why use Eclipse?

I'd just build a list of "naughty words", and use find and grep to search the codebase for occurrences. Then visit each file an review the hits. (You could automate the latter by adding a "FIXME" style comment at the start of each flagged file, and use Eclipse's work-list support to go through the flagged files. Whether it is worth it depends on the number of hits you have to look at.)

Bear in mind that you will get both false positives (depending on how prudish you are) and false negatives ... where the author says something offensive without using naughty words.

CodePro Analytix has one static code analysis detector called "Inappropriate language" just for that. You can easily add more naughty words to its configuration and afterwards use it in distributed teams or automated static code analysis investigations.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top