markcheret / footnotes

footnotes aims to be the all-in-one solution for displaying an automatically-generated list of references on your WordPress Page or Post.
https://wordpress.org/plugins/footnotes/#description
GNU General Public License v3.0
7 stars 5 forks source link

Review codebase #87

Open Rumperuu opened 3 years ago

Rumperuu commented 3 years ago

Currently, this Plugin is made of 145 files. I ran SLOCCount on it, and got the following results:

SLOC Directory SLOC-by-Language (Sorted)
3843 class php=3843
406 js javascript=406
219 _tools sh=219
50 contrib sh=50
28 top_dir php=21,xml=7
0 css (none)
0 img (none)
0 languages (none)
0 templates (none)

Totals grouped by language (dominant language first): php: 3864 (85.00%) javascript: 406 (8.93%) sh: 269 (5.92%) xml: 7 (0.15%)

Total Physical Source Lines of Code (SLOC) = 4,546 Development Effort Estimate, Person-Years (Person-Months) = 0.98 (11.77) (Basic COCOMO model, Person-Months = 2.4 * (KSLOC*1.05)) Schedule Estimate, Years (Months) = 0.53 (6.38) (Basic COCOMO model, Months = 2.5 (person-months**0.38)) Estimated Average Number of Developers (Effort/Schedule) = 1.84 Total Estimated Cost to Develop = $ 132,481 (average salary = $56,286/year, overhead = 2.40).

This feels substantially larger than should be necessary for a Plugin with as tightly-defined a scope as this one. I suspect that there is a significant amount of unnecessary or outdated code, that would be well worth refactoring out.

Because this will be useful for tackling other issues too, I intend to run over the codebase and produce an 'architectural overview' (which I'll add to the repo. Wiki), which should a) help me and everyone else grasp just what everything does and why and b) help identify duplicated and unnecessary functionality, things that can be consolidated, things that can be separated (i.e., no more inline JS in PHP files), etc.

markcheret commented 3 years ago

I so welcome this effort. Can you please share the COCOMO settings you used? I’d like to make this estimation part of an automated routine to help me understand the progress over time.

Rumperuu commented 3 years ago

I so welcome this effort. Can you please share the COCOMO settings you used?

I just used whatever defaults SLOCCount uses.

I’d like to make this estimation part of an automated routine to help me understand the progress over time.

+1

Rumperuu commented 3 years ago

Wiki pages added here.