fast-redact icon indicating copy to clipboard operation
fast-redact copied to clipboard

Code needs comments

Open jsumners opened this issue 7 years ago • 1 comments

As with #7, the whole codebase needs to be commented. It is very difficult to understand everything that is going on in this project. Without some explanations in the code, it is basically impossible for others to come along and contribute, e.g. #5.


With the non-descriptive variable names, this function is a mystery. A leading comment describing the parameters and what the function accomplishes would help: https://github.com/davidmarkclements/fast-redact/blob/3bc8dbe3547542b22b44262067d7390d5efc37b8/lib/modifiers.js#L61-L87

It is difficult to understand at first that this is building an object of compiled paths (if I even understand it?). A description of what is going on along with sample inputs and outputs would be very helpful: https://github.com/davidmarkclements/fast-redact/blob/3bc8dbe3547542b22b44262067d7390d5efc37b8/lib/parse.js#L10-L42

Brief introductions to each function should be present: https://github.com/davidmarkclements/fast-redact/blob/3bc8dbe3547542b22b44262067d7390d5efc37b8/lib/redactor.js

Explanations of when these functions get used and how: https://github.com/davidmarkclements/fast-redact/blob/3bc8dbe3547542b22b44262067d7390d5efc37b8/lib/restorer.js

jsumners avatar Oct 06 '18 15:10 jsumners

I agree - it's a necessarily tricky code base but there's no reason for lack of comments

This is now a todo, but I'm in a time bottleneck atm - it will be done when I'm able though

davidmarkclements avatar Oct 07 '18 01:10 davidmarkclements