Comments (15)
+1 for separating:
Lines Of Code
Lines of Comments
from plato.
I am also wondering about how this works, because my javadoc style comments usually double my SLOC.
from plato.
Yes, they are being counted, we'll get on that. Thanks for the reminder.
from plato.
This would be a very welcome fix! Some of my files are now reported as having 1000+ lines of code (http://fabricjs.com/report/) because of hundreds of jsdoc comments. As in this file, for example — https://github.com/kangax/fabric.js/blob/master/src/shapes/text.class.js#L57-L199 150 lines of pure comments and that's not even all of it.
from plato.
Should this be closed? Lines are lines and comment lines do add noise which is not something to completely disregard. If source is reported as bloated because of comments that may be something to still consider as a potential maintainability issue.
from plato.
Not in my opinion. IMHO, the only comments that add noise are commented out code, not comments that denote purpose or intent. If you can't distinguish between those, then you have to not count comments against maintainability. For density consideration, an example: A five line JS file (a function, 3 lines), and two lines of comments describing what it does to future maintainers (maybe some with not so much experience). That file is (2/5) 40% comments, and IMO reasonable. Too noisy? What is comment bloat?
from plato.
I would add a different metric, code lines with and without comments, and
let each one decide what bloated is...
On Tue, Oct 15, 2013 at 10:33 PM, Alex Grant [email protected]:
Not in my opinion. IMHO, the only comments that add noise are commented
out code, not comments that denote purpose or intent. If you can't
distinguish between those, then you have to not count comments against
maintainability. For density consideration, an example: A five line JS file
(a function, 3 lines), and two lines of comments describing what it does to
future maintainers (maybe some with not so much experience). That file is
(2/5) 40% comments, and IMO reasonable. Too noisy? What is comment bloat?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/25#issuecomment-26386701
.
from plato.
I can add an alternate view that counts the logical lines of code. It wouldn't be a count that simply omits comments, but it would provide insight into how much "code" really exists.
from plato.
@jsoverson That would work for me. As I mentioned earlier, for any JSDoc-documented code, this is kind of a big deal. In cases like this, comments are certainly not bloat (although I know what you meant; cases of overly commented code that's more of a smell than help).
from plato.
Actually, you could add the comment lines as a seperate metric, which would even make it possible to calculate the code/comment ratios for a given file. Not implying any best practices here, but choice is always good.
Keep up the good work and thanks for what you've done so far.
from plato.
Has any progress been done here?
from plato.
Would welcome this as well. Just removed 60% of bloat from a particular file (unused 'common' functions), but I gave the remaining functions their own docblocks (because yay docs). End result, file 'appears' to be the same length of code.
from plato.
I would also appreciate a few separate counts. (SLOC with comments, SLOC without comments, SLOC without comments or empty lines).
I tend to write a ton of documentation, and I'm wary of hitting my coworkers with a 1000 line PR that's really 500 lines of comments, and 500 lines of logic.
from plato.
Bump
from plato.
+1
from plato.
Related Issues (20)
- Complete ES6+ / ES7 / edge complexity reporting support HOT 4
- Example of how to combine with babel for ES6 module imports HOT 2
- Complexity Numbers are inconsistent (Main Page and Per-File)
- TypeError: undefined is not a function HOT 3
- Unexpected ESLint error "Newline required at end of file but not found." HOT 5
- Eslint config different from original
- Do you want a PR for es6-capability / eslint? HOT 4
- -x exclude files or folders is not working HOT 3
- Error running with node v6.9.1; Cannot read property 'lastIndexOf' HOT 3
- Security static analysis HOT 1
- Project maintenance HOT 24
- Plato is listing LintErrors not found with ESLint HOT 3
- Arrow functions are being shown as anonymous functions HOT 2
- Disable JSHint errors report HOT 1
- dynamic import causes SyntaxError: Unexpected token (37:30) HOT 1
- How to Specify Valid File Extensions?
- Latest version of plato (1.7.0) using a vulnerable version of lodash (4.13.1) HOT 6
- Not support async function
- runtime error, if path not existing HOT 1
- Plato HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plato.