Forum > General

[SOLVED] Code metrics for Lazarus FPC - number of code lines

(1/1)

tudi_x:
hi All,
please advise if there is an option in Lazarus IDE to provide information on the number of code lines for the files in project (i think the ones in the project folder could be considered only).
i did not find it in version 1.8RC5 but is there maybe in trunk?

i am developing on Windows and the feature could come handy.
thank you

howardpc:
Tools->Options
In IDE Options dialog, under the Environment node click on Messages Window, and in the page that is shown make sure that Show FPC message "lines compiled" is checked.

Note this is just a crude line count of the project. It includes blank lines and comments, compiler directives etc., so the number of lines contributing to compiled code will be smaller.
But the number of "code" lines is in any case an ambiguous quantity. Consider these identical programs:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---programproject1; begin  Writeln  (  'This is a test'  )  ;    Readln  ; end.17 lines


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program project1; begin  Writeln('This is a test');  Readln;end.7 lines


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program project1; begin Writeln('This is a test'); Readln; end.1 line

tudi_x:
thank you!

Navigation

[0] Message Index

Go to full version