Recent

Author Topic: Include Informative Line Count Statistics  (Read 2079 times)

wp

  • Hero Member
  • *****
  • Posts: 12856
Re: Include Informative Line Count Statistics
« Reply #15 on: May 13, 2025, 11:11:18 pm »
And then OPM?
(Though someone else needs to explain the steps)
Ideally there should be a GitHub/GitLab/Sourceforge repository where the sources are hosted (and maintained). When a release is ready to be included in OPM send a mail to opm@lazarus-ide.org in which you provide the link to the sources. In OPM, after you changed your profile to "Package maintainer" in the "Options" dialog, you find a button "Create" > "Create repository package" in which you can create a zip file plus some meta data (json) for the package; specify the version compatibility and widgetset requirements. Important also: a short description of the package, and make your mind about a license - packages without licenses will not be accepted. Include the json containing all this in the mail to OPM - this is what users will first see from this package.

And most important: Since nobody of the Lazarus team will have access to your repository it is required that you will be willing to maintain the package, at least check it from time to time to verify that it still is working.

munair

  • Hero Member
  • *****
  • Posts: 880
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Include Informative Line Count Statistics
« Reply #16 on: May 13, 2025, 11:31:51 pm »
It's only logical.

munair

  • Hero Member
  • *****
  • Posts: 880
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Include Informative Line Count Statistics
« Reply #17 on: May 13, 2025, 11:36:15 pm »
Thanks wp!
It's only logical.

munair

  • Hero Member
  • *****
  • Posts: 880
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Include Informative Line Count Statistics
« Reply #18 on: May 14, 2025, 10:59:14 am »
Any TStrings descedant, including TMemo.Items, has a count property that equals the number of lines. I would use that.
I used something similar in the package for IDE implementation.
It's only logical.

wp

  • Hero Member
  • *****
  • Posts: 12856
Re: Include Informative Line Count Statistics
« Reply #19 on: May 14, 2025, 03:53:03 pm »
Package is now on Github:
https://github.com/ssgeos/ProjectMetrics
Thanks for sharing. Some ideas for improvements (just my 2 cents...):
  • When I double-click on the file projectmetricsdlg.pas in the package editor the file is not loaded into the editor. This is unusual. It is because this file is a "virtual unit" (https://wiki.freepascal.org/Lazarus_Packages#File_Type). I think, this is by accident and not intentional. Making the file a normal "unit" would fix the issue (right-click on the unit in the package editor > "File type" > "Unit" instead of "Virtual unit").
  • The results in "Metrics per file" are a bit hard to read because the lines are longer than the width of the form. Yes there is an option for "wordwrap", but then still the number are hard to find and to compare. I think this could be improved by displaying these values in a stringgrid, and maybe also in a chart - see attachment (made by using Excel)
  • The files in "Metrics per file" maybe should be sorted alphabetically, or by size, or maybe by click on the grid header.
« Last Edit: May 14, 2025, 03:56:25 pm by wp »

munair

  • Hero Member
  • *****
  • Posts: 880
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Include Informative Line Count Statistics
« Reply #20 on: May 14, 2025, 03:58:30 pm »
Good points. Yes, the file was accidentally virtual (I tested with a temp project to edit the form). I realize that simple text is harder to read and the package would benefit from a string grid. I'll see if I can make adjustments in the coming days.
It's only logical.

munair

  • Hero Member
  • *****
  • Posts: 880
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Include Informative Line Count Statistics
« Reply #21 on: May 14, 2025, 10:53:36 pm »
The package has been updated. The memo's have been replaced by stringgrids.
https://github.com/ssgeos/ProjectMetrics
It's only logical.

Nicole

  • Hero Member
  • *****
  • Posts: 1146
Re: Include Informative Line Count Statistics
« Reply #22 on: May 20, 2025, 07:33:08 pm »
This is very nice and worth to add it to Lazarus 4 as default!

 

TinyPortal © 2005-2018