Issue 4672 in pharo: Lines of code of compiled methods

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 4672 in pharo: Lines of code of compiled methods

pharo
Status: Accepted
Owner: [hidden email]
CC: [hidden email]

New issue 4672 by [hidden email]: Lines of code of compiled methods
http://code.google.com/p/pharo/issues/detail?id=4672

We have the following method:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CompiledMethod>>linesOfCode
        "An approximate measure of lines of code.
        Includes comments, but excludes empty lines."
        | lines |
        lines := 0.
        self getSource asString lineIndicesDo: [:start :endWithoutDelimiters :end |
                endWithoutDelimiters > start ifTrue: [lines := lines+1]].
        ^lines
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Why empty lines are excluded? Does it make sense ? Why not simply "^ self  
getSource lineCount"
White lines are important.



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4672 in pharo: Lines of code of compiled methods

pharo

Comment #1 on issue 4672 by [hidden email]: Lines of code of  
compiled methods
http://code.google.com/p/pharo/issues/detail?id=4672

because empty lines are empty. Do you think a method gets more "complex" by  
adding empty lines?
LOC is a dumb metric in all cases, but removing empty lines is the minimum  
to do...

(For any kind of metric, we should count message sends instead, this is in  
depended of formatting)



_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4672 in pharo: Lines of code of compiled methods

pharo
Updates:
        Status: Invalid

Comment #2 on issue 4672 by [hidden email]: Lines of code of  
compiled methods
http://code.google.com/p/pharo/issues/detail?id=4672

(No comment was entered for this change.)


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 4672 in pharo: Lines of code of compiled methods

pharo

Comment #3 on issue 4672 by [hidden email]: Lines of code of  
compiled methods
http://code.google.com/p/pharo/issues/detail?id=4672

Considering empty and comments lines when counting lines is an old debate.
Counting the amount of lines can be used as a simple proxy for assessing  
the complexity, but it can be use for different purpose (to get an estimate  
of the size of an application for instance).
To assess complexity there are dedicated metrics, such as the cyclomatic  
complexity.
I am personally in favor of counting empty lines. It would be cool to haver  
other opinion.


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker