Giter VIP home page Giter VIP logo

Comments (15)

jmullo avatar jmullo commented on June 18, 2024 3

+1 for separating:

Lines Of Code
Lines of Comments

from plato.

calmdev avatar calmdev commented on June 18, 2024

I am also wondering about how this works, because my javadoc style comments usually double my SLOC.

from plato.

jsoverson avatar jsoverson commented on June 18, 2024

Yes, they are being counted, we'll get on that. Thanks for the reminder.

from plato.

kangax avatar kangax commented on June 18, 2024

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.

jsoverson avatar jsoverson commented on June 18, 2024

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.

localnerve avatar localnerve commented on June 18, 2024

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.

opensas avatar opensas commented on June 18, 2024

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.

jsoverson avatar jsoverson commented on June 18, 2024

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.

kangax avatar kangax commented on June 18, 2024

@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.

bjoernklose avatar bjoernklose commented on June 18, 2024

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.

DimitrK avatar DimitrK commented on June 18, 2024

Has any progress been done here?

from plato.

darrennolan avatar darrennolan commented on June 18, 2024

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.

Riizade avatar Riizade commented on June 18, 2024

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.

Robert-Ernst avatar Robert-Ernst commented on June 18, 2024

Bump

from plato.

vedmant avatar vedmant commented on June 18, 2024

+1

from plato.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.