RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Tue Dec 23, 2025 10:53 am

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Source Code Statistics
PostPosted: Fri May 25, 2012 6:33 am 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
I generated some initial reports for the rr source and thought I'd share and summarise a small subset here:

363 files
479 classes
2896 methods
58 javadocs :-(
20343 non-comment source statements (lines of code)

Four biggest packages:

com.romraider.maps
com.romraider.swing
com.romraider.logger.ecu.ui.tab.dyno
com.romraider.logger.ecu

Four biggest classes:

com.romraider.logger.ecu.ui.tab.dyno.DynoControlPanel
com.romraider.logger.ecu.EcuLogger
com.romraider.maps.Table
com.romraider.maps.Table3D

Three classes with most methods (100 each :-o):

com.romraider.logger.ecu.EcuLogger
com.romraider.maps.Table
com.romraider.Settings

Most complex methods, in order:

com.romraider.xml.DOMRomUnmarshaller.unmarshallTable(Node,Table,Rom)
com.romraider.maps.Table3D.colorize()
com.romraider.logger.ecu.ui.handler.injector.InjectorUpdateHandler.handleDataUpdate(Response)
com.romraider.swing.SettingsForm.mouseClicked(MouseEvent)
com.romraider.logger.ecu.ui.tab.dyno.DynoControlPanel.loadFromFile()
com.romraider.logger.external.te.io.TERunner.run()
com.romraider.maps.Table.colorize()
com.romraider.logger.ecu.ui.handler.dyno.DynoUpdateHandler.handleDataUpdate(Response)

Test coverage: None :-(
Duplication/copy/paste: Not too bad! :-)
Fragility/use of interfaces/abstract classes: Pretty bad! :-(
Findbugs bugs: ~100 :-)
PMD violations: ~100 :-)
Vars/params that could/should be final and aren't: 3000+ :-|
Duplicated string literals: ~300 :-|
Magic numbers: 4360 :-o
Lines over 160 chars: 371 meaningless
Parameter assignment: 30 :-( yuck
CCN "too high": 43 :-(
Visibility too wide: 100 :-|
Entry points: 6 (why not 2?) :-/
IllegalCatch: 119 :-(
Hidden fields that aren't constructors or setters: 63 :-(
Number of vars that are naturally zero initialised to zero: 77 :-|
Files not ending in newline: 68 (yucky windows)
Static imports: 900 :-o :shock:
Empty if/then/else: 47 :-(
Inline conditionals: 63 :-|
If/else/for without braces: 268 :-( :-( <cries>

Overall, not too bad! Better than I was expecting! :-)

Once I get the maven stuff committed and public anyone can generate these at home in a few minutes and view the full results locally.

Hope you found it interesting :-)

Fred.

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
 Post subject: Re: Source Code Statistics
PostPosted: Wed May 30, 2012 10:05 am 
Offline
RomRaider Developer

Joined: Wed May 20, 2009 9:49 pm
Posts: 7314
Location: Canada eh!
Different developers sure do have different writing styles. I agree there's much to clean up.
I've come across this site http://www.javapractices.com/ a number of times while researching something. It probably addresses many of the Common Task/Practice items that Maven caught.


Top
 Profile  
 
 Post subject: Re: Source Code Statistics
PostPosted: Wed May 30, 2012 9:57 pm 
Offline
Experienced
User avatar

Joined: Thu Apr 19, 2012 3:44 am
Posts: 385
There are some good ones in there! Here are a few that I spotted:

http://www.javapractices.com/topic/TopicAction.do?Id=14
http://www.javapractices.com/topic/Topi ... .do?Id=227
http://www.javapractices.com/topic/Topi ... .do?Id=224
http://www.javapractices.com/topic/TopicAction.do?Id=23

Re rom load:

http://www.javapractices.com/topic/TopicAction.do?Id=34

Currently the source is set to 1.5, however it'd be good to upgrade it to 1.6 at some point. (re generics)

However there is some out of date stuff too:

http://www.javapractices.com/topic/Topi ... .do?Id=241 < CVS
http://www.javapractices.com/topic/Topi ... .do?Id=135 < Ant

:-)

_________________
The type of scooby that I most enjoy!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl