SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Codequality on 22.09.06

REMARK

  • This goal of the presentation of the results of different analysis tools is not to give an absolut assessment of the quality of our code. Some threshold are selected without deeper analysis (although they seem to be appropriate) and some of the style checks are definitely not that important or not in accordance with our (or eclipse's) style. Nevertheless the results might be interesting.
  • This data was collect before we started a bigger refactoring. It should be a good reference to evaluate the improvements.
  • It gives also rise to some refactorings that were previously not considered. For example the code duplication found by Simian encourages to extract some methods.

Code under analysis

  • CsiNavigator
  • LocationAPI
  • ToolCreateMapGraph
  • FitCommonFixtures

Eclipse

  • Number of warnings: 125
  • Number of TODO items: 54

JUnit

  • Tests: 59
  • Errors: 5
  • Failures: 4
  • Ratio (Tests/Code): 1055 / 7409 (Lines of code), 20 / 86 (Classes), 7 / 13 (Packages)

Coverlipse

http://coverlipse.sourceforge.net/index.php

(Plugin was already installed by Andreas.)

org.cs3.csi.AllTestsForCoverlipse0.95
org.cs3.csi.app.Configuration0.4
org.cs3.csi.app.test.TestDateBug1.0
org.cs3.csi.app.test.ConfigurationTest1.0
org.cs3.csi.gpsmock.MockTimeProvider0.42
org.cs3.csi.map.CoordinateTransformation0.725
org.cs3.csi.map.graph.Museum0.66
org.cs3.csi.map.graph.PointOfInterest0.43
org.cs3.csi.map.graph.StreetAttributes0.53
org.cs3.csi.map.graph.Node0.78
org.cs3.csi.map.graph.Edge0.94
org.cs3.csi.map.graph.DijkstraAllRoutesBelowThreshold1.0
org.cs3.csi.map.graph.Hotel0.5
org.cs3.csi.map.graph.Address0.85
org.cs3.csi.map.graph.Dijkstra1.0
org.cs3.csi.map.graph.CalculateEstimatedArrivalTimeModel0.0
org.cs3.csi.map.graph.DijkstraShortestPath1.0
org.cs3.csi.map.graph.MapGraph0.25
org.cs3.csi.map.graph.filters.CompositeFilter1.0
org.cs3.csi.map.graph.filters.TypeFilter1.0
org.cs3.csi.map.graph.filters.AreaFilter1.0
org.cs3.csi.map.graph.filters.test.AreaFilterTest1.0
org.cs3.csi.map.graph.filters.test.TypeFilterTest1.0
org.cs3.csi.map.graph.filters.test.CompositeFilterTest1.0
org.cs3.csi.map.graph.test.NodeTest1.0
org.cs3.csi.map.graph.test.MapGraphTest0.92
org.cs3.csi.map.graph.test.EdgeTest1.0
org.cs3.csi.map.graph.test.DijkstraShortestPathTest1.0
org.cs3.csi.map.graph.test.CalculateEstimatedArrivalTimeTest0.59
org.cs3.csi.map.test.CoordinateTransformationTest0.50
org.cs3.csi.map.test.MapTest0.03
org.cs3.csi.profile.UserProfile0.27
org.cs3.csi.sim.PathHistory0.95
org.cs3.csi.sim.test.PathHistoryTest1.0
org.cs3.csi.ui.TravelInformationModel0.68
org.cs3.csi.ui.test.TravelInformationModelTest1.0
org.cs3.csi.ui.test.TravelInformationWidgetTest0.08
org.cs3.csi.ui.test.TravelInformationModelTest$MockChangeListener1.0
org.cs3.csi.utils.OS0.35
org.cs3.csi.utils.OS$WindowsNT0.4
org.cs3.csi.utils.HandleFiles0.3
org.cs3.csi.utils.test.HandleFilesTest0.46
org.cs3.csi.utils.test.OSTest1.0

CAP

http://cap.xore.de/

(Andreas already installed this plugin. Select a project and select Show CA from the contex menu.) (For background see slide 26 and 27 in Saskia's presentation .)

  • 39 cycles
  • Distance > 0.4:
    • javax.microedition.location
    • org.cs3.csi.profile
    • org.cs3.csi.route
    • org.cs3.csi.utils
  • Four biggest packages:
    • org.cs3.csi.grouplib
    • org.cs3.csi.ui
    • org.cs3.csi.map.graph
    • javax.microedition.location

QJ-Pro

http://qjpro.sourceforge.net/

(You have to tell Eclipse to show you also the incompatibel plugins. Once you got it, you have to open the QJPro View manually. Then everything works fine. If you forget to open the view, you just get an silent error.)

  • Has many suggestions how to improve the code. Unfortunately there is no export.
  • It complains about the tabs. Are we happy with tabs? Personally I would avoid them but if we don't have any problems with them, we can use them.
  • Unfortunately I found no export functionality. It can generate a copy of the source with warnings merged right between the lines.

Metrics

There are two cycles:

nodes=9, diameter=3:
org.cs3.csi.ui, org.cs3.csi.map.graph, org.cs3.csi.profile, org.cs3.csi.app, org.cs3.csi.map.test, org.cs3.csi.map, org.cs3.csi.map.graph.filters, org.cs3.csi.ui.actions, org.cs3.csi.grouplib
nodes=2 diameter=1:
org.cs3.csi.sim, org.cs3.csi.sim.actions

Here are the selected save ranges and an overview of the results:

The results are in the attached XML File (500MB). If anyone could quickly extract the important values, that would be nice.

Lack of Cohesion of Methods
StaticGraphBoundary1
MapGraphBoundary0,945
StartTimeDialog0,944
CsiNavigator0,892
PointOfInterest0,889
GroupDefinitionStart0,881
CsiNavigatorSimulator0,867
GroupJoinDialog20,867
GroupJoinDialog0,855
GroupOrganisationWindow0,835
TravelInformationModel0,815
TravelInformationWidget0,812
Edge0,802
McCabe Cyclomatic Complexity
Util.minorToName111
Util.idToName39
Util.uuidToName31
Util.printDataElement20
Util.attrTypeToName18
MapGraphBoundary.paintControl12
Client.receivePacket11
Dijkstra.dijkstra11
GroupPacket.toString11
StaticGraphBoundary.drawNode11
Method Lines of Code
GroupOrganisationWindow.initGUI137
Util.idToName118
Util.minorToName114
GroupJoinDialog.initComponents112
GroupDefinitionStart.initGUI99
GroupJoinDialog2.initComponents96
GroupCreateDialog.open94
OptionsDialog.open94
MapGraph.addPointOfInterestToGraph70
MapGraphTest.setUp70
MapGraphTest.setUp70
Util.uuidToName62
GroupDefinitionStart.GroupDefinitionStart61
GruopInteractionScreen.initGUI58
Util.attrTypeToName55
CoordinateTransformationTest.testCoordinateTransformation45
CoordinateTransformationTest.testCoordinateTransformation45
CsiNavigator.main45
Dijkstra.dijkstra45
MapGraphBoundary.MapGraphBoundary42
Nested Block Depth
GroupDefinitionStart.initGUI6
Normalized Distance
org.cs3.csi.utils1
org.cs3.csi.profile0,8
org.cs3.csi.map.graph0,794
org.cs3.csi.app0,75
org.cs3.csi.sim0,75
org.cs3.csi.map0,533
Number of Classes
org.cs3.csi.ui19
org.cs3.csi.grouplib13
org.cs3.csi.map.graph13
org.cs3.csi.map12
Number of Parameters
Hotel.Hotel11
Museum.Museum11
PointOfInterest.PointOfInterest10
Restaurant.Restaurant10
MapGraphBoundary.drawEdge9
MapGraphBoundary.drawEdge8

Detailed images of some tangles:

SA4J

Creole

Simian

http://www.integility.com/simian_ui

Checkstyle

http://checkstyle.sourceforge.net/

  • Checkstyle does not agree with our coding style at all. ;-)
  • A complete list with the numbers of warnings is attached.
  • Here is a pie chart that gives us an idea about the kind of warnings and their distribution:

teaching/labs/xp/2006b/codequality22.09.06.txt · Last modified: 2020/11/26 13:39 by Daniel Speicher

SEWiki, © 2021