A very useful tool to "measure" the source code metrics is sloccount. It is claimed to support also the Pascal syntax:
https://dwheeler.com/sloccount/
In recent debians is natively available for apt installation.
It is also in Manjaro's repository. I tried "$ sloccount ." in Lazarus source directory.
It gives a long list of warnings, much longer than my Konsole buffer length.
Most are like this :
Warning: newline in string - file /home/juha/SW/lazarus/tools/svn2revisioninc.pas, line 405
Line 405 in svn2revisioninc.pas is :
// Use or's short circuiting to make sure only the last succesful function writes to RevisionStr
Thus the warnings are false. sloccount thinks a quote char inside a comment starts a Pascal string.
Other warnings are like this :
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "",
LC_ALL = (unset),
LC_ADDRESS = "fi_FI.UTF-8",
LC_NAME = "fi_FI.UTF-8",
LC_MONETARY = "fi_FI.UTF-8",
LC_PAPER = "fi_FI.UTF-8",
LC_IDENTIFICATION = "fi_FI.UTF-8",
LC_TELEPHONE = "fi_FI.UTF-8",
LC_MEASUREMENT = "fi_FI.UTF-8",
LC_TIME = "fi_FI.UTF-8",
LC_NUMERIC = "fi_FI.UTF-8",
LANG = "fi_FI"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
sloccount is made partly with Perl. Does anybody know how to get rid or such a warning?
Finally it gives a report :
SLOC Directory SLOC-by-Language (Sorted)
1304278 components pascal=1303710,sh=431,ansic=137
792887 lcl pascal=699801,cpp=93069,sh=17
354500 ide pascal=354500
41508 packager pascal=41508
28463 examples pascal=27809,java=609,sh=45
23537 designer pascal=23537
21980 tools pascal=19242,sh=2525,perl=213
11374 test pascal=11292,sh=82
9872 converter pascal=9872
6168 doceditor pascal=6167,sh=1
1709 debugger pascal=1709
184 docs pascal=96,perl=84,sh=4
19 top_dir sh=10,pascal=9
3 images sh=3
0 install (none)
0 languages (none)
0 lazarus.app (none)
0 startlazarus.app (none)
0 units (none)
Totals grouped by language (dominant language first):
pascal: 2499252 (96.26%)
cpp: 93069 (3.58%)
sh: 3118 (0.12%)
java: 609 (0.02%)
perl: 297 (0.01%)
ansic: 137 (0.01%)
Total Physical Source Lines of Code (SLOC) = 2,596,482
Development Effort Estimate, Person-Years (Person-Months) = 769.37 (9,232.43)
(Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months) = 6.69 (80.31)
(Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 114.96
Total Estimated Cost to Develop = $ 103,931,263
(average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."
2 and a half million lines. Cost to Develop = 104 million dollars.
Heh
The source is now in SourceForge apparently.
https://sourceforge.net/projects/sloccount/Lazarus should have an IDE plugin package providing statistics like this.