Borg Source Statistics

These are the current statistics of the C-source code. The statistics are made with the halstead program. Every module is examined to determine the following:

n1 == number of unique operators
n2 == number of unique operands
N1 == number of total operators
N2 == number of total operands

The program outputs these fields:
File Name
Program Length -- (N = N1 + N2)
Program Volume -- (V = N log (n1 + n2))
Program Level -- (L = (2/n1) * (n2/N2))
Mental Discriminations -- (E^ = V / L)

The program volume (aka ``Halstead Volume'') is probably most useful and seems to be reasonably well correlated with error counts for modules. The tables below are sorted according to the Halstead Volume. The lower the number, the higher the risc for bugs.

cborgcore.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../cborgcore/*.cpp                   0         nan       nan       nan
../../cborgcore/RouterPriority.c        7729      68841     0.004493  15323276
../../cborgcore/RouterReal.c            6912      60921     0.004807  12672923
../../cborgcore/Scan.c                  5490      48246     0.005331  9049995
../../cborgcore/Memory.c                3672      30338     0.006212  4883536
../../cborgcore/NatArithmetic.c         1888      13216     0.009134  1446893
../../cborgcore/Sockets.c               1581      12085     0.009524  1268840
../../cborgcore/Evaluator.c             3582      27754     0.009590  2894152
../../cborgcore/NatRelational.c         1579      10374     0.009926  1045090
../../cborgcore/Files.c                 980       6893      0.010998  626754
../../cborgcore/NatStructure.c          2104      15022     0.012016  1250146
../../cborgcore/Context.c               1054      7134      0.014539  490665
../../cborgcore/Debug.c                 898       6599      0.015620  422481
../../cborgcore/NatTranscendental.c     1192      7795      0.016052  485578
../../cborgcore/Natives.c               1568      12445     0.017311  718895
../../cborgcore/NatHooks.c              715       4903      0.017364  282395
../../cborgcore/NatDebug.c              1318      10238     0.018693  547702
../../cborgcore/Scheduler.c             569       4008      0.020529  195248
../../cborgcore/NatString.c             719       4913      0.020941  234602
../../cborgcore/Dictionary.c            626       3742      0.021993  170134
../../cborgcore/NatFiles.c              1043      7814      0.022712  344046
../../cborgcore/StdPalm.c               1554      12102     0.023292  519596
../../cborgcore/NatConversion.c         779       5426      0.023527  230646
../../cborgcore/Call.h                  514       3150      0.024281  129752
../../cborgcore/Agent.c                 834       5963      0.024375  244631
../../cborgcore/StdPalm.h               3419      31204     0.024664  1265183
../../cborgcore/AbstractGrammar.h       1679      13255     0.025966  510487
../../cborgcore/Natives.h               2233      18881     0.029642  636969
../../cborgcore/Interfacing.c           812       6050      0.033632  179899
../../cborgcore/NatTime.c               362       2282      0.034706  65752
../../cborgcore/Memory.h                559       3907      0.034837  112140
../../cborgcore/StdLinux.c              242       1424      0.036934  38544
../../cborgcore/Context.h               314       1832      0.039437  46442
../../cborgcore/StdSolaris.c            206       1191      0.043275  27521
../../cborgcore/NatAgent.c              644       4557      0.043518  104725
../../cborgcore/NatBoolean.c            566       3272      0.043843  74635
../../cborgcore/Queue.c                 555       3594      0.045508  78975
../../cborgcore/StdLinux.h              356       2390      0.045977  51988
../../cborgcore/StdSolaris.h            451       2990      0.046525  64263
../../cborgcore/Borg.h                  537       4093      0.047891  85466
../../cborgcore/NatMeta.c               422       2828      0.049686  56909
../../cborgcore/NatTable.c              264       1590      0.056044  28369
../../cborgcore/NatSockets.c            421       2654      0.058045  45721
../../cborgcore/RouterLess.c            460       3107      0.062193  49961
../../cborgcore/Errors.c                216       1324      0.063084  20987
../../cborgcore/Errors.h                625       4271      0.066881  63853
../../cborgcore/Segments.h              456       2560      0.067434  37967
../../cborgcore/Scheduler.h             155       846       0.071429  11847
../../cborgcore/StdFreebsd.h            244       1534      0.075980  20185
../../cborgcore/Sockets.h               214       1254      0.077226  16233
../../cborgcore/Router.h                263       1728      0.079342  21778
../../cborgcore/NatInteraction.c        418       2672      0.081699  32705
../../cborgcore/AllHeaders.h            101       450       0.090395  4983
../../cborgcore/StdWindows.h            207       1281      0.098007  13074
../../cborgcore/NatMemory.c             212       1203      0.101415  11858
../../cborgcore/StdWindows.c            90        469       0.102767  4562
../../cborgcore/Queue.h                 316       1903      0.113680  16741
../../cborgcore/Agent.h                 332       2068      0.121693  16993
../../cborgcore/Dictionary.h            139       682       0.138298  4932
../../cborgcore/StdHeaders.h            120       630       0.138528  4546
../../cborgcore/StdMacintosh.h          40        160       0.153846  1040
../../cborgcore/Debug.h                 121       630       0.168421  3743
../../cborgcore/NatObjects.c            35        151       0.232143  652
../../cborgcore/Interfacing.h           36        133       0.266667  500
../../cborgcore/StdPlatform.c           32        106       0.291667  364
../../cborgcore/Files.h                 70        329       0.312925  1051
../../cborgcore/Router.c                14        39        0.333333  118
../../cborgcore/NatRouter.c             22        81        0.450000  181
../../cborgcore/Globals.h               132       752       0.588235  1279
../../cborgcore/Library.c               6         16        0.666667  23
../../cborgcore/ExtraNatives.h          2         2         2.000000  1

bborgcore.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../bborgcore/*.cpp                   0         nan       nan       nan
../../bborgcore/Natives.c               1507      12030     0.016920  710995
../../bborgcore/NatJit.c                1061      8015      0.023723  337881
../../bborgcore/AbstractGrammar.h       1679      13255     0.025966  510487
../../bborgcore/Natives.h               1794      15284     0.031095  491539
../../bborgcore/ExtraNatives.h          18        65        0.350000  184

kborg.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../kborg/*.c                         0         nan       nan       nan
../../kborg/KwDoc.cpp                   14570     144365    0.005063  28511427
../../kborg/KwView.cpp                  13791     138007    0.005848  23599324
../../kborg/SyntaxColor.cpp             4295      36100     0.006720  5371927
../../kborg/KpTextLine.cpp              6107      55184     0.007120  7751088
../../kborg/KwDialog.cpp                6616      58604     0.008115  7221486
../../kborg/TopLevel.cpp                6793      64600     0.010094  6399605
../../kborg/RtfReader.cpp               5856      55274     0.010695  5168164
../../kborg/Library2.cpp                3004      25236     0.013474  1872937
../../kborg/KpFontHeights.cpp           1050      7753      0.015485  500683
../../kborg/WidgetAPI.cpp               4624      43390     0.016509  2628239
../../kborg/RtfWriter.cpp               967       7123      0.019027  374378
../../kborg/RtfReader.h                 1718      15000     0.020969  715344
../../kborg/BorgCore.cpp                1298      10463     0.022090  473642
../../kborg/KpTextLine.h                1470      12166     0.023704  513244
../../kborg/Stack.cpp                   234       1404      0.028295  49619
../../kborg/KwDialog.h                  1035      8005      0.030288  264306
../../kborg/KwDoc.h                     1276      10512     0.032511  323346
../../kborg/KdeMain.cpp                 318       2033      0.034203  59432
../../kborg/WidgetAPI.h                 1514      13092     0.035242  371497
../../kborg/RtfWriter.h                 429       2973      0.035674  83345
../../kborg/KwView.h                    1585      13818     0.038114  362527
../../kborg/TopLevel.h                  923       7608      0.043184  176185
../../kborg/SyntaxColor.h               168       992       0.043956  22576
../../kborg/DebugWindow.cpp             589       4205      0.044322  94878
../../kborg/BorgCore.h                  422       3074      0.051224  60020
../../kborg/Library2.h                  562       4201      0.062512  67209
../../kborg/DebugWindow.h               217       1356      0.072816  18620
../../kborg/KpFontHeights.h             129       749       0.079365  9439
../../kborg/XpmInclude.h                877       4602      0.093750  49093
../../kborg/DebugWindowData.cpp         173       966       0.106996  9030
../../kborg/Stack.h                     54        257       0.136000  1888
../../kborg/Library0.cpp                36        163       0.148148  1099
../../kborg/Library1.cpp                36        163       0.148148  1099

wborg.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../wborg/*.cpp                       0         nan       nan       nan
../../wborg/SyntaxColor.c               6631      58251     0.005410  10768077
../../wborg/File.c                      1603      12288     0.009959  1233817
../../wborg/BorgMain.c                  3839      34330     0.010907  3147507
../../wborg/LibB0.c                     2533      21428     0.011240  1906316
../../wborg/Commands.c                  2125      17186     0.011529  1490686
../../wborg/Find.c                      1045      7642      0.012928  591106
../../wborg/Rtf.c                       1702      13141     0.013334  985525
../../wborg/Print.c                     1264      9852      0.014403  684016
../../wborg/Document.c                  2204      18812     0.016092  1168991
../../wborg/ToolBar.c                   774       5565      0.021346  260695
../../wborg/Status.c                    622       4502      0.024149  186441
../../wborg/BorgMain.h                  1684      14239     0.028164  505564
../../wborg/AgentName.c                 420       2699      0.028669  94144
../../wborg/About.c                     526       3688      0.029172  126419
../../wborg/Call.h                      370       2109      0.030769  68548
../../wborg/LibB1.c                     105       547       0.040385  13545
../../wborg/SyntaxColor.h               381       2548      0.047697  53411
../../wborg/Lib.h                       86        344       0.086275  3987
../../wborg/Resource.h                  78        426       0.180000  2366
../../wborg/Rtf.h                       300       2284      1.950000  1171

tborg.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../tborg/*.cpp                       0         nan       nan       nan
../../tborg/*.h                         0         nan       nan       nan
../../tborg/tborg.c                     2425      20434     0.012399  1648066

pborg.html

                                        Program   Program   Halstead  Mental
Filename                                Length    Volume    Volume    Discrimination
../../pborg/*.cpp                       0         nan       nan       nan
../../pborg/UILibHHPalm.c               7307      60808     0.004703  12928999
../../pborg/PalmBorg.c                  1786      14739     0.018669  789499
../../pborg/UILibHHPalm.h               472       3176      0.063576  49949
../../pborg/PalmBorgSegments.h          39        174       0.160000  1087
../../pborg/PalmBorgIDs.h               81        468       2.000000  234