Class Name

MapsMIDlet
MapBackground
Outlook
DelRoute
MapObjects
CompassCanvas
PVector
Point
MathFP
ImageCanvas3
TextFormFriend
TextFormWP
TextForm
Thread4Friend
MapsMIDlet
SelectorPoint
Friend
SimpleTextForm
MapBackgroundFactory
HeapSorter
TextFormImage
Coordinates
CommaHyphenString

Maintainability
0.4696
0
0.0490881667
0.068318936
0
0.0490881667
0.068318936
0.2540449746
0.0981763335
0.0490881667
0.068318936
0.2049568079
0.1366378719
0.1174071027
0.4696284108
0
0.0490881667
0.068318936
0.2049568079
0.1857260387
0.1366378719
0.1366378719
0.1366378719

CBO
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

CYC_Classes
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

DAC
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

DIT ILCOM LCOM
0
2
75
0
4
480
0
1
3
0
1
0
0
1
311
0
1
0
0
3
255
0
10
1164
0
1
732
0
1
0
0
2
0
0
10
112
0
5
67
0
3
37
0
2
75
0
1
70
0
3
20
0
3
11
0
1
0
0
0
169
0
3
40
0
4
68
0
0
25

LD
0.9909
1.923
0.9
1
1
0.864
1
1.3
0.875
1
0
0
0
1
0.991
1
1
0
0
0
0
0.285
0

LEN
10
13
7
8
10
13
7
5
6
12
14
10
8
13
10
13
6
14
20
10
13
11
17

LOC
1356
616
103
23
370
291
313
699
440
52
52
175
103
173
1356
520
50
70
32
125
75
266
80

LOD_Class MPC
0.667
152
0.29
27
0.917
19
0.75
0
0.4
54
1
78
0.334
25
0.18
33
0.86
0
1
5
0.33
0
0.077
0
0.67
2
0.875
5
0.67
152
0.381
90
0.889
1
0.5
0
0.5
1
0.929
0
0.556
0
0
31
0.167
0

NAM
134
77
21
5
41
26
21
60
46
3
7
23
16
16
134
28
12
11
2
13
11
21
6

NOC
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

NOM
11
30
11
3
29
3
17
38
34
2
5
12
11
7
11
20
8
7
1
13
8
10
5

RFC
95
40
27
3
53
14
32
45
34
6
5
12
12
11
95
63
9
7
1
13
8
20
5

Example Java Project Tested by
VizzMaintenance Metrics Eclipse Plugin

Zarko Acimovic
Copyright © 2013 Zarko Acimovic
All rights reserved.

TCC
0.1429
0.207
0.436
0
0.29
1
0.037
0.074
0.16
1
0.4
0.03
0.145
0.048
0.143
0.36
0.25
0.29
0
0
0.107
0.083
0

WMC
142
59
20
3
70
13
40
51
95
6
5
12
11
18
142
71
9
7
1
27
8
16
13

DEDICATION
I dedicate this book to my parents, Ivana and Goran

CONTENTS
1

Introduction

4

2

Means and Practices for Defect Prevention in Java
Software Development

4

3

EXAMPLE TOOLS FOR DEFECT PREVENTION IN
JAVA PROJECTS

5

4

Sample Project Specifications

5

5

METRICS

6

6

VizzMaintenance Report For Sample Project

7

7

Java Source Code

8

8

About the Author

170

2.95 Source: Chapter 3.8.IEEE Standard Classification for Software Anomalies. Estimating and Measuring Software Quality. Tool: Coverity Mathematical test case design defect prevention efficiency was 34%. Tool: ArgoUML Static analysis of source code defect prevention method has efficiency 44%. I wrote the code in 2004 and ever since had several business offers to commercialize it which I resisted due to complexity of the code. 2 MEANS AND PRACTICES FOR DEFECT PREVENTION Prototyping (modeling) defect prevention method has efficiency 52%. such as B. After the project was written. VizzMaintenace tool was run against it and delivered report for it. after.Zarko Acimovic 1 INTRODUCTION I present 5000 lines of Java source code mostly written by using trial-error.3. Efficiency 41% . after is 3. Defect potential per 1 FP was 5. The Economics of Software Quality. Capers Jones. code-test.Before 5 – After 2. VDM or Z. Each class is preceded with VizzMaintenace report and comment about class design issue based on VizzMaintenance judgment. Event-B. Olivier Bonsignour iv . design-at-keyboard “techniques” without using VizzMaintenance defect prevention tool. Tool: Bullseye Bonus: Root cause analysis 1044-1993 . Before implementing this method defect potential per 1 FP (function point) was 5. Defect potential per 1 FP is 5.4. I recommend readers to switch to formal software development. after implementing this method is 2. The code was written for prototype project in three months. ISBN: 9780132564762 .

15 Java 2 Micro Edition classes Tools used: Sun J2ME Wireless Toolkit. type.com/store/product. MapObject. MIDP 2. zoom in-out and pan. Eclipse. editing and deletion of waypoint – points with coordinates.amazon. 5000 lines of code (including comments). selection of waypoint as destination and navigation towards that destination. distance) for selecting destination or editing and deletion. icon. measuring distance.gmxhome. following individual or vehicle on map with route presentation. Technology: J2ME.com/Economics-Software-Quality-Capers-Jones/dp/0132582201 http://www. name. presentation of list of existing waypoints (sorted by name.informit. for displaying map with scale. selection of location .stateofflow.com/projects/16/eclipsemetrics Dependency Analysis JDepend4Eclipse http://andrei.aspx?isbn=0132582201 3 EXAMPLE TOOLS FOR DEFECT PREVENTION IN JAVA PROJECTS Source: http://codedependents. selected location on map or inserted in textual form. Device-independent Java 2 Micro Edition (J2ME) midlet.de/jdepend4eclipse/ Source Code Analysis PMD http://pmd. creating.net/ 4 SAMPLE PROJECT SPECIFICATION Project duration 3 months.0. presentation of waypoints on map. executable in any emulator or mobile device. CLDC 1. Motorola and Nokia phone emulators and SDKs.sourceforge. following moving objects.5.sourceforge.1.net/ Code Complexity Analysis http://www. IBM WebSphere Device Developer 5. Some classes implemented: MapBackground.eclemma. type.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin http://www. CVS.com/2009/07/01/top-5-static-analysis-plugins-for-eclipse/ Code Coverage tool EclEmma http://www. v . coordinates are defined by current position.org/ Byte Code Analysis FindBugs http://findbugs. single developer .

SelectorPoint. MapsMIDlet 5 METRICS (CLICK ON LINK FOR DETAILS) •Complexity •Size •Lines of Code (LOC) •Interface Complexity •Number of Attributes and Methods (SIZE2) •Number Of local Methods (NOM) •Structural Complexity •McCabe Cyclomatic Complexity (CC) •Weighted Method Count (WMC) •Response For a Class (RFC) •Architecture and Structure •Inheritance •Depth of Inheritance Tree (DIT) •Number Of Children (NOC) •Coupling •Afferent Coupling (Ca) •Coupling Between Objects (CBO) •Change Dependency Between Classes (CDBC) •Change Dependency Of Classes (CDOC) •Efferent Coupling (Ce) vi .Zarko Acimovic Point. PVector.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin •Coupling Factor (CF) •Data Abstraction Coupling (DAC) •Instability (I) •Locality of Data (LD) •Message Passing Coupling (MPC) •Package Data Abstraction Coupling (PDAC) •Cohesion •Lack of Cohesion in Methods (LCOM) •Improvement of LCOM (ILCOM) •Tight Class Cohesion (TCC) •Design Guidelines and Code Conventions •Documentation •Lack Of Documentation (LOD) •Code Conventions 5 VIZZMAINTENANCE REPORT FOR SAMPLE PROJECT vii .

03 0.*.9 1 1 0.145 0.077 0 0.36 0.arisa.16 1 0.864 1 1.1366378719 0.068318936 0.18 33 0. That is the relative number of directly connected public methods in the class.se/compendium/node112.875 1 0 0 0 1 0.html Here is the CommaHyphenString.0490881667 0.html Also there is problem with Tight Class Cohesion.29 0 0 0.037 0.929 0 0.1174071027 0.1366378719 0.html we learn more about Loclity of Data metric: The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class.2049568079 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.381 90 0.889 1 0.436 0 0. From http://www.074 0.068318936 0.991 1 1 0 0 0 0 0.4 54 1 78 0.arisa.5 0 0.se/compendium/node118.2049568079 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .1429 0. 8 9 public class CommaHyphenString { 10 11 //String s. It eliminates commas or low lines 4 * from . This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability.923 0.1857260387 0.util.875 5 0.0490881667 0.29 27 0.properties file.917 19 0.29 1 0.107 0.1366378719 0.properties file so items in it( such as categories) could be properly 5 * showed on screen 6 */ 7 import java. 12 int lastIndex.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.143 0.4696284108 0 0. http://www.0490881667 0.2540449746 0.207 0.33 0 0.667 152 0.25 0.arisa.3 0.java source code 1 2 3 /** * * CommaHyphenString parses .334 25 0.048 0.67 2 0.556 0 0 31 0.4696 0 0. Classes having a low cohesion indicate errors in the design.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0. viii TCC 0.86 0 1 5 0. The Tight Class Cohesion metric measures the cohesion between the public methods of a class.0981763335 0.9909 1.4 0.67 152 0.068318936 0 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 6 SOURCE CODE As you can see in the above table the problem with below CommaHyphenString class is that LD metric is zero.0490881667 0. To find out precisely how this metric is calculated and how it affects software quality attributes such as testability or maintainability please check http://www.5 1 0.068318936 0.75 0 0.se/compendium/node112.

k+=tempChar[j].addElement(s. String k = "".length.indexOf('. for (int j=0.size()] = s.length. j<tempChar. i++){ char[] tempChar = temp[i].s. if(lastIndex==0){ String[] ss = new String[1]. i++){ ss[i] = (String)v. j++){ if(tempChar[j]=='_') tempChar[j]=' '.size()+1].elementAt(i). } } /** Eliminates low line * @return String[] */ String[] getStringsOnly(String s){ String[] temp = this. } ss[v. returns array of strings with low line * @return String[] */ String[] getWithLowLine(String s) { int lastIndex = defineLast(s). ss[0] = s. for (int i=0. String[] ss = new String[v.substring(lastIndex+1. } temp[i] = k.').substring(start+1. int current = s. } /** Returns categories with low line * @return String[] ix .Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 CommaHyphenString(){} /** Eliminates commas.size().toCharArray(). } return temp.current+1). return ss. } while (start!=lastIndex). start = current. Vector v = new Vector(). for(int i=0.current)).indexOf('. i<v.length()). i<temp.getWithLowLine(s). do { v. } else { int start = -1.'. return ss. current = s.

0490881667 0. i<c.207 0.1366378719 0.917 19 0.5 1 0.556 0 0 31 0.0490881667 0.length. char c[] = s.0490881667 0.4 54 1 78 0. } /** Defines index of last comma in string * @return integer */ public int defineLast(String s){ int lastIndex = 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .1857260387 0.4696 0 0.068318936 0.068318936 0.25 0.991 1 1 0 0 0 0 0.getWithLowLine(s).037 0.29 1 0.4696284108 0 0. i++){ if(c[i]=='.29 27 0.9 1 1 0.9909 1.074 0.2049568079 0.3 0.67 152 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity x LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.Zarko Acimovic 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString */ String[] getCategoriesHyphen(String s){ return this.2540449746 0.068318936 0 0. } } Maintainability 0.0981763335 0.929 0 0.36 0.864 1 1.1174071027 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.077 0 0.145 0.889 1 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.143 0.048 0.33 0 0.16 1 0.436 0 0.1366378719 0. } return lastIndex.4 0.068318936 0. for (int i=0.') lastIndex=i.getStringsOnly(s).2049568079 0.18 33 0.1429 0.107 0. } /** Returns categories * @return String[] */ String[] getCategories(String s){ return this.75 0 0.875 5 0.334 25 0.0490881667 0.29 0 0 0.923 0.667 152 0.1366378719 0.03 0.67 2 0.toCharArray().5 0 0.381 90 0.86 0 1 5 0.875 1 0 0 0 1 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions xi .

0. int dummy1 int dummy2 int dummy3 int dummy4 Image img. public class CompassCanvas extends Canvas implements Runnable{ long north.microedition. long east. considering one class comment and a comment per method as optimum. CompassCanvas. long destDown.lcdui.arisa. MapObjects mob. long south.java source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 /** * * ComapssCanvas draws compass on screen */ import javax.html . Structure and content of the comments are ignored. xii . 0. long west. int bigRadius. int smallestRadius.se/compendium/node121. boolean switchVar = false.*. boolean end = false. To find out how this metric is calculated please check http://www.Zarko Acimovic Documentation Lack Of Documentation (LOD) Code Conventions As you can see on the above table the problem with below class CompassCanvas is that LOD metric is zero.*.microedition. 0. Thread t. Lack Of Documentation description: How many comments are lacking in a class. boolean switched = false. long delta = 0. int smallRadius. //import javax. = = = = 0. Image imgDest. long destUp.midlet. Coordinates c. long gama.

MathFP.indexOf('. 67 g. 70 71 //System. 65 g.toFP("2")).drawImage(img.toFP(75).fillRect(0.indexOf('.delta))))).out.MathFP.getWidth().toFP(93).toFP("0.sub(north. 73 g.MathFP. 74 g. 50 smallestRadius = (int)(0.createImage("Dest. 40 north = MathFP. 49 smallRadius = (int)(0. 75 76 String sx = MathFP.toFP(75).ix).MathFP_2PI.smallRadius.25.MathFP.div(Coordinates.360).createImage("Arrow2.MathFP_2PI.min(this.mob = mob.360).jpg").smallRadius.add(MathFP.75.0.getWidth().jpg"). 51 try{ 52 img = Image.println("this.toString(MathFP.').sub(MathFP.start().drawArc(8.div(Coordinates. 78 int ix = sx.bigRadius.MathFP_2PI.out.getHeight()). 44 45 destUp = MathFP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 36 37 38 CompassCanvas(MapObjects mob){ 39 this. xiii .out.0).getHeight()="+this.255).toFP(85). 79 sx = sx.mul(Coordinates.mul(MathFP. 57 }catch(Exception e){} 58 59 t = new Thread(this).75*bigRadius).delta))))).this.setColor(255.toFP("0. 41 south = MathFP. 66 g.toString(delta)).MathFP.75")). 61 } 62 63 public void paint(Graphics g){ 64 //System.getWidth()="+this. 47 48 bigRadius = Math.toFP("0").setColor(0.this.mul(MathFP. 77 String sy = MathFP.0.mul(Coordinates.25")).toFP("2")).getWidth()).').println("delta="+MathFP.getHeight()).37*bigRadius).MathFP.getHeight()). 60 t.substring(0.MathFP.toFP("0"). 46 destDown = MathFP.0.MathFP_2PI. 42 east = MathFP.this.sin(Ma thFP.0. 72 //System. 53 }catch(Exception e){} 54 55 try{ 56 imgDest = Image.0).MathFP. 68 if(end == false){ 69 g.sub(north.cos(Ma thFP.println("this.255. 80 int iy = sy. 43 west = MathFP.toString(MathFP.drawArc(30.22.0.bigRadius.

sin(MathFP.x.delta))))).MathFP.Zarko Acimovic 81 sy = sy.add(MathFP.mul(MathFP.sub(MathFP. 112 iy = s12. 102 sy = sy.y. 109 s11 = s11.0).toString(MathFP. 92 s10 = s10.M athFP. 87 ix = s9. 89 int NX = Integer.toFP(75). 111 String s12 = MathFP.toFP(smallestRadius).substring(0.').parseInt(sy).M athFP.').substring(0. 98 sy = MathFP.MathFP.MathFP.mul(MathFP.cos(MathFP.toFP(75).parseInt(s9).parseInt(s12).parseInt(s11).sin(MathFP.mul(MathFP. 114 int SY = Integer. 88 s9 = s9.iy).').delta))))).sub(south.sub(south.delta))))).indexOf('.drawString("N".').add(MathFP.iy).sub(MathFP.delta))))).toFP(85). 90 String s10 = MathFP.toFP(93). 110 int SX = Integer.cos(Ma thFP.').mul(MathFP. 82 83 int x = Integer.sub(south.indexOf('. 106 107 String s11 = MathFP.substring(0. 113 s12 = s12.M athFP. 91 iy = s10.ix).MathFP.mul(MathFP. 103 104 x = Integer. 84 int y = Integer.parseInt(sx). 119 int del = 0.toFP(smallestRadius).toFP(85).parseInt(sy).delta))))).substring(0.y.ix).x.toFP(93).MathFP.parseInt(s10).sub(north.indexOf('. 105 y = Integer.MathFP.'). xiv . 99 ix = sx. 96 97 sx = MathFP.iy).cos(MathFP.add(MathFP.toFP(smallestRadius).sub(south.toString(MathFP.toString(MathFP.M athFP.toString(MathFP.sin(Ma thFP.parseInt(sx).sub(MathFP. 94 95 g.mul(MathFP.indexOf('.substring(0.drawString("S".substring(0. 100 sx = sx.iy).toString(MathFP.ix).toString(MathFP.indexOf('.0).sub(north. 85 86 String s9 = MathFP.indexOf('.toFP(93).toFP(85). 115 116 117 118 g.delta))))). 101 iy = sy.MathFP. 93 int NY = Integer.MathFP.toFP(smallestRadius).substring(0. 108 ix = s11.

parseInt(s2). 156 iy = sy.mul(MathFP.MathFP.indexOf('. 158 xv .toFP(93).indexOf('.ix).delta))))).ix). 153 sy = MathFP.toString(MathFP.substring(0.toFP(10).toFP(93).toString(MathFP.dummy4). 155 sx = sx.MathFP.delta))))). 127 128 String s3 = MathFP.toFP(85).MathFP.MathFP.SX-del.sin(Ma thFP.dummy3.MathFP.sin(Ma thFP.dummy1.toFP(75).delta))))).sub(west.sub(MathFP.NY-del.toFP(85).SX-del.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 120 g. 133 dummy1 = Integer.toFP(85).dummy4. 141 dummy3 = Integer.abs((NX-SX)/2).substring(0.cos(Ma thFP.').sub(west.NY-del.mul(MathFP.mul(MathFP. 130 131 ix = s1.toFP(10).sin(Ma thFP. 150 g.MathFP.delta))))).MathFP.drawLine(NX-del.indexOf('.sub(east.sub(east.NY-del.').indexOf('. 124 125 String s1 = MathFP.MathFP.substring(0.abs((NY-SY)/2). 151 152 sx = MathFP.cos(Ma thFP.drawLine(dummy1.cos(Ma thFP. 136 s2 = s2.MathFP.toString(MathFP.parseInt(s1). 134 135 ix = s2.SX-del.substring(0.ix).toString(MathFP.sub(MathFP.delta))))). 140 s3 = s3. 132 s1 = s1.').sub(east. 138 139 ix = s3.').indexOf('. 148 g.toString(MathFP.drawLine(dummy3.toFP(93).').SY-del).mul(MathFP.delta))))).sub(east.drawLine(NX-del. 157 sy = sy.'). 121 122 int mediumX = (int)Math.dummy2).dummy2.add(MathFP.parseInt(s4).iy). 144 s4 = s4.toFP(10).mul(MathFP. 126 String s2 = MathFP.ix). 129 String s4 = MathFP. 145 dummy4 = Integer.toFP(10).SY-del).ix).substring(0.substring(0.MathFP.sub(MathFP.mul(MathFP.parseInt(s3).drawLine(NX-del.toFP(75). 123 int mediumY = (int)Math.toString(MathFP.MathFP.SY-del). 154 ix = sx.indexOf('.add(MathFP.MathFP. 149 g. 146 147 g.add(MathFP. 137 dummy2 = Integer. 142 143 ix = s4.

x.toString(MathFP.toFP("360")). 188 189 long dx = 0.parseInt(sy). 191 192 if(gamaDegrees<=0) { 193 gama = MathFP.mul(MathFP.0).delta))))).degreesToRadians(gama).delta))))).toFP(93). 180 //gama = MathFP. 195 } 196 197 // Correction of position for imgDest xvi .toFP(85).mul(MathFP.sub(destUp. 187 long corrY = MathFP. 175 176 177 178 179 gama = MathFP.parseInt(sx). 169 sy = sy.sub(west.Zarko Acimovic 159 x = Integer.toFP(75).parseInt(sy).x.sub(MathFP.toString(gamaDegrees)).cos(Ma thFP.ix). 181 long gamaDegrees = Coordinates.MathFP. 170 171 x = Integer. 194 gamaDegrees = MathFP. 172 y = Integer.add(MathFP.toFP(93).toFP(smallestRadius).indexOf('.add(gama.mul(MathFP.add(gamaDegrees.MathFP.MathFP. 190 long dy = 0.sin(MathFP .out. 183 //System.cos(MathFP .').').MathFP. 168 iy = sy.drawString("W". 161 162 g.toString(MathFP.mul(MathFP.sub(delta.drawString("E".substring(0.MathFP.MathFP. 167 sx = sx.sub(MathFP.MathFP. 160 y = Integer. 173 174 g.gama)))).gama)))).toFP(smallestRadius).substring(0.add(MathFP.MathFP.indexOf('. 184 //gama = Coordinates.sin(Ma thFP.gama).MathFP_2PI).sub(destUp. 182 //long gamaDegrees = gama.parseInt(sx). 166 ix = sx.MathFP. 185 186 long corrX = MathFP.0).Coordinates.y.sub(west.iy). 165 sy = MathFP.toFP(75).toFP("314"). 163 164 sx = MathFP.println("gama="+MathFP.toFP(85).radiansToDegrees(gama).y.

mul(MathFP.toFP("25"). 200 dy = 0MathFP.mul(MathFP.MathFP.cos(gama)).toFP("50")<=gamaDegrees && gamaDegrees <MathFP.toFP("175")<=gamaDegrees && gamaDegrees<MathFP.mul(MathFP.sin(gama)).toFP("10")){ 199 dx = 0MathFP.toFP("0")<=gamaDegrees && gamaDegrees <MathFP.toFP("23").toFP("7").toFP("10")<=gamaDegrees && gamaDegrees <MathFP.sin(gama)).toFP("25"). 216 dy = 0MathFP.toFP("50")){ 205 dx = 0MathFP. 222 } 223 224 225 if(MathFP.sin(gama)).MathFP.toFP("30").MathFP.toFP("7").MathFP.cos(gama)).toFP("25").sin(gama)).mul(MathFP.MathFP.toFP("10").toFP("85")<=gamaDegrees && gamaDegrees<MathFP.MathFP.cos(gama)).MathFP.mul(MathFP.toFP("85")){ 215 dx = 0MathFP. 201 } 202 203 204 if(MathFP.mul(MathFP.cos(gama)).toFP("23"). 228 } 229 xvii .toFP("67")<=gamaDegrees && gamaDegrees <MathFP.toFP("175")){ 220 dx = 0MathFP.MathFP.toFP("275")){ 226 dx = MathFP.toFP("12"). 221 dy = 0MathFP.toFP("12").MathFP. 211 dy = 0MathFP.MathFP.toFP("40"). 212 } 213 214 if(MathFP.mul(MathFP.mul(MathFP. 217 } 218 219 if(MathFP. 207 } 208 209 if(MathFP.mul(MathFP.cos(gama)).mul(MathFP.MathFP.mul(MathFP.toFP("67")){ 210 dx = 0MathFP.sin(gama)). 227 dy = MathFP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 198 if(MathFP.cos(gama)).mul(MathFP. 206 dy = 0MathFP.MathFP.cos(gama)).

249 ix = sx. 250 sx = sx.iy).toString(prevCorrX).substring(0.toString(MathFP.MathFP.ix). 240 long prevCorrY=corrY.indexOf('. 264 int ybear3 = Integer.parseInt(sy).substring(0. 253 int xbear1 = Integer.mul(MathFP.mul(MathFP.iy). xviii .sin(MathFP.MathFP.cos(gama)).dy).indexOf('.toString(MathFP.add(corrX. 263 int xbear3 = Integer. 232 dy = 0MathFP.indexOf('.Zarko Acimovic 230 if(MathFP.').toFP(93).substring(0. 269 sy = MathFP.parseInt(sy). 255 256 257 sx = MathFP.toFP("275")<=gamaDegrees && gamaDegrees<=MathFP.MathFP.indexOf('.sub(destDown.toString(corrY).M athFP.'). 265 266 267 268 sx = MathFP.cos(gama)).parseInt(sx).ix).mul(MathFP. 270 271 272 ix = sx.toString(prevCorrY). 260 sx = sx. 261 iy = sy. 241 242 corrX = MathFP.toFP(85).parseInt(sx). 244 245 246 247 sx = MathFP.toFP(smallestRadius).add(MathFP. 243 corrY = MathFP. 262 sy = sy.').gama))))).MathFP. 233 234 } 235 236 237 238 239 long prevCorrX=corrX.mul(MathFP. 248 sy = MathFP. 254 int ybear1 = Integer. 258 sy = MathFP.substring(0.add(corrY.toFP("25").M athFP.toString(corrX).cos(MathFP.substring(0.'). 259 ix = sx.toFP("8").sub(destDown.toFP("360")){ 231 dx = 0MathFP. 251 iy = sy.toFP(smallestRadius).ix).gama))))). 252 sy = sy.sub(MathFP. 273 sx = sx.dx).indexOf('.').

parseInt(sy).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 iy = sy.parseInt(sx).xbear3.0).ybear1. } } public void run(){ while(end == false){ delta = mob. int xbear2 = Integer.').xbear1.sleep(100). g. sy = sy.getBearing(). g. int ybear2 = Integer. repaint().ybear3).ybear2.indexOf('. } } xix .drawLine(xbear2. gama = mob.drawImage(imgDest.iy).substring(0. }catch(Exception e){} } } public void setEnd(){ end = true. try{ Thread.getDirection().

Zarko Acimovic
Class Name
MapsMIDlet
MapBackground
Outlook
DelRoute
MapObjects
CompassCanvas
PVector
Point
MathFP
ImageCanvas3
TextFormFriend
TextFormWP
TextForm
Thread4Friend
MapsMIDlet
SelectorPoint
Friend
SimpleTextForm
MapBackgroundFactory
HeapSorter
TextFormImage
Coordinates
CommaHyphenString

Maintainability
0.4696
0
0.0490881667
0.068318936
0
0.0490881667
0.068318936
0.2540449746
0.0981763335
0.0490881667
0.068318936
0.2049568079
0.1366378719
0.1174071027
0.4696284108
0
0.0490881667
0.068318936
0.2049568079
0.1857260387
0.1366378719
0.1366378719
0.1366378719

CBO
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

CYC_Classes
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

DAC
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

DIT ILCOM LCOM
0
2
75
0
4
480
0
1
3
0
1
0
0
1
311
0
1
0
0
3
255
0
10
1164
0
1
732
0
1
0
0
2
0
0
10
112
0
5
67
0
3
37
0
2
75
0
1
70
0
3
20
0
3
11
0
1
0
0
0
169
0
3
40
0
4
68
0
0
25

LD
0.9909
1.923
0.9
1
1
0.864
1
1.3
0.875
1
0
0
0
1
0.991
1
1
0
0
0
0
0.285
0

Complexity
Size
Lines of Code (LOC)
Interface Complexity
Number of Attributes and Methods (SIZE2)
Number Of local Methods (NOM)
Structural Complexity
McCabe Cyclomatic Complexity (CC)
Weighted Method Count (WMC)
Response For a Class (RFC)

Architecture and Structure
Inheritance
Depth of Inheritance Tree (DIT)
Number Of Children (NOC)
Coupling
Afferent Coupling (Ca)
Coupling Between Objects (CBO)
Change Dependency Between Classes (CDBC)
Change Dependency Of Classes (CDOC)

xx

LEN
10
13
7
8
10
13
7
5
6
12
14
10
8
13
10
13
6
14
20
10
13
11
17

LOC
1356
616
103
23
370
291
313
699
440
52
52
175
103
173
1356
520
50
70
32
125
75
266
80

LOD_Class MPC
0.667
152
0.29
27
0.917
19
0.75
0
0.4
54
1
78
0.334
25
0.18
33
0.86
0
1
5
0.33
0
0.077
0
0.67
2
0.875
5
0.67
152
0.381
90
0.889
1
0.5
0
0.5
1
0.929
0
0.556
0
0
31
0.167
0

NAM
134
77
21
5
41
26
21
60
46
3
7
23
16
16
134
28
12
11
2
13
11
21
6

NOC
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

NOM
11
30
11
3
29
3
17
38
34
2
5
12
11
7
11
20
8
7
1
13
8
10
5

RFC
95
40
27
3
53
14
32
45
34
6
5
12
12
11
95
63
9
7
1
13
8
20
5

TCC
0.1429
0.207
0.436
0
0.29
1
0.037
0.074
0.16
1
0.4
0.03
0.145
0.048
0.143
0.36
0.25
0.29
0
0
0.107
0.083
0

WMC
142
59
20
3
70
13
40
51
95
6
5
12
11
18
142
71
9
7
1
27
8
16
13

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin
Efferent Coupling (Ce)
Coupling Factor (CF)
Data Abstraction Coupling (DAC)
Instability (I)
Locality of Data (LD)
Message Passing Coupling (MPC)
Package Data Abstraction Coupling (PDAC)
Cohesion
Lack of Cohesion in Methods (LCOM)
Improvement of LCOM (ILCOM)
Tight Class Cohesion (TCC)

Design Guidelines and Code Conventions
Documentation
Lack Of Documentation (LOD)
Code Conventions

As you can see on above table, Coordinates class has problem with metrics LD and TCC. TCC or Tight Class
Cohesion Description: The Tight Class Cohesion metric measures the cohesion between the public methods of a
class. That is the relative number of directly connected public methods in the class. Classes having a low cohesion
indicate errors in the design. http://www.arisa.se/compendium/node118.html
Locality of Data. Description. The Locality of Data metric relates the amount of data being local the class to the
total amount of data used by the class. This relates to the quality of abstraction embodied by the class and allows
conclusions on the reuse potential of the class and testability. http://www.arisa.se/compendium/node112.html

Coordinates.java source code

1
2
3
4
5
6
7
8

/**
*
* Coordinates class different performs geographical calculations
*/

//import net.jscience.math.MathFP;

xxi

Zarko Acimovic

9 public class Coordinates {
10
/**
11
* Earth's radius (in meters)
12
*/
13
public static final long EARTH_RADIUS = MathFP.toFP(6367000);
14
public static final long EARTH_RADIUS2 = MathFP.toFP(6367000*2);
15
/**
16
* the WGS-84 latitude of a location
17
*/
18
private long latitude;
19
/**
20
* the WGS-84 longitude of a location
21
*/
22
private long longitude;
23
/**
24
* The altitude of the location in meters, defined as height above WGS-84
ellipsoid. Float.NaN can be used to indicate that the altitude is not known.
25
*/
26
27
28
/**
29
* Constructor
30
* @param
latitude
latitude as WGS-84 system coordinate
31
* @param
longitude
longitude as WGS-84 system coordinate
32
* @param
altitude
the altitude in meters, if known, or Float.NaN
33
* @param
timestamp
the time when information stored in this object
was created, in milliseconds since midnight January 1, 1970 GMT, or -1
34
* @param
source
the short string describing where data contained
in this object came from, like "GPS", "Network", "Database", etc
35
* @param
horizontalAccuracy
the horizontal accuracy of coordinates
in meters, or Float.NaN
36
* @param
verticalAccuracy
vertical accuracy of coordinates in
meters, or Float.NaN
37
*/
38
public Coordinates(long latitude, long longitude){
39
this.latitude=latitude;
40
this.longitude=longitude;
41
}
42
43
/**
44
* Copy constructor
45
* @param
original
copied object
46
*/
47
public Coordinates(Coordinates original){
48
this.latitude=original.latitude;
49
this.longitude=original.longitude;
50
}
51
52
53
/**
54
* The WGS-84 latitude of a location
xxii

getLongitude()). 88 * bearing . getLongitude(). 94 } 95 /** 96 * Calculate bearing between points (latFrom. 80 * @param longitude longitude as WGS-84 system coordinate 81 */ 82 public void setLongitude(long longitude){ 83 this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 55 * @return WGS-84 latitude 56 */ 57 public long getLatitude(){ 58 return latitude. to.getLatitude().360) between corresponding meridian in first point and line on the Great Circle between those points 91 */ 92 public long bearing(Coordinates to){ 93 return bearing(getLatitude().understanding of one's position 89 * @param to another point 90 * @return long representing angle in degrees [0.1.direction shown by compass 4.connection 3. 97 * @param latFrom latitude of the first point 98 * @param lonFrom longitude of the first point 99 * @param latTo latitude of the second point xxiii .longitude=longitude. 84 } 85 86 /** 87 * Calculate bearing to another location on the surface of the Earth. 67 } 68 69 70 /** 71 * Set latitude as WGS-84 system coordinate. to. using the Great Circle. 76 } 77 78 /** 79 * Set longitude as WGS-84 system coordinate. 59 } 60 61 /** 62 * The WGS-84 longitude of a location 63 * @return WGS-84 longitude 64 */ 65 public long getLongitude(){ 66 return longitude. 72 * @param latitude latitude as WGS-84 system coordinate 73 */ 74 public void setLatitude(long latitude){ 75 this.lonTo) on the surface of the Earth. using the Great Circle. lonFrom) and (latTo.way of behaving 2.latitude=latitude.

cos(latTo)).MIN_VALUE) // Double. 109 if (MathFP.PI)).g.sin(lon2lon1)*Math.mod(radiansToDegrees(bearing). 138 xxiv .MathFP.MIN_VALUE a small number ~ machine precision. it is not CLDC 1.atan2(deltaLat.MIN_VALUE a small number ~ machine precision. 120 121 122 if (latFrom==latTo && lonFrom==lonTo) 123 return 0. long lonTo){ 104 //BMa: Some numeric with MathFP still happen .cos(latFrom) < Double.MathFP.sin(latFrom).atan2(Math.PI. long latTo. 117 latTo = degreesToRadians(latTo).mul(MathFP.deltaLon). // starting from S pole 130 //double bearing = radiansToDegrees(Math.mul(MathFP. 119 lonTo = degreesToRadians(lonTo).sin(deltaLon).Math. MathFP.1) 106 long bearing.Zarko Acimovic 100 * @param lonTo longitude of the second point 101 * @return long representing angle in degrees [0.cos(lat1)*Math.cos(latFrom). // starting from N pole 128 else 129 return MathFP_2PI.sin(lat1)*Math.sin(latTo))135 MathFP. so here we check for +/-0 126 if (latFrom > 0) 127 return MathFP. 124 //if (MathFP.mul(MathFP.abs(deltaLon)<MathFP_1) { 110 // longiude and latitude distance within one deegre. 136 } 137 bearing = MathFP.cos(deltaLon))) .abs(deltaLat)<MathFP_1 && MathFP. 107 long deltaLat=latTo-latFrom. 134 MathFP. 131 132 bearing = MathFP.MathFP. could invent better condition 111 //This approximation works better for smaller distances 112 latFrom = degreesToRadians(latFrom).but error is mostly below 16 degrees 105 // This should be fixed only if the final target device stays without not have floats or doubles (e.mul(deltaLon.atan2( 133 MathFP.cos(lat2)*Math.360) between corresponding meridian in first point and line on the Great Circle between those points 102 */ 103 protected static long bearing(long latFrom.cos(lat2).cos(latFrom)).cos(lon2-lon1))%(2*Math. long lonFrom. so here we check for +/-0 125 if (MathFP. 108 long deltaLon=lonTo-lonFrom.MathFP. 114 bearing = MathFP. 115 }else{ 116 latFrom = degreesToRadians(latFrom).mul(MathFP. 118 lonFrom = degreesToRadians(lonFrom). MathFP_360).sin(lat2)Math.cos(latTo)).cos(latFrom) == 0 ) // Double. 113 deltaLon=MathFP.

sin(latFrom)*MathFP. 174 lonFrom = degreesToRadians(lonFrom). using the Great Circle.asin( xxv . [-180. getLongitude(). 145 * @param to another point 146 * @return distance to another location in meters. 156 * lat . to. lon . long lonFrom.errors happen sometimes 150 // This should be fixed only if the final target device stays without not have floats or doubles (e. +90].degrees ([-90.sin(latTo) + MathFP. using the line on the Great Circle 147 */ 148 public long distance(Coordinates to){ 149 //BMa: Some numeric with MathFP are still possible .Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 139 if (bearing<0) bearing = MathFP_360 + bearing. using the line on the Great Circle 163 */ 164 public static long calculateDistance(long latFrom. using the Great Circle. 176 //long distance = R * MathFP.lonTo) on the surface of the Earth.acos(MathFP. 141 } 142 143 /** 144 * Calculate distance to another location on the surface of the Earth. 140 return bearing.getLatitude().cos(lonTo-lonFrom)). +180]) 157 * 158 * @param latFrom latitude of the first point 159 * @param lonFrom longitude of the first point 160 * @param latTo latitude of the second point 161 * @param lonTo longitude of the second point 162 * @return distance to another location in meters.1) 151 return calculateDistance(getLatitude(). 173 latTo = degreesToRadians(latTo).g. 177 /* 178 double distance = R * 2 * Math.cos(latTo)*MathFP.getLongitude()). long lonTo){ 165 /* 166 * d=2*asin(sqrt((sin((latFrom-latTo)/2))^2 + cos(latFrom)*cos(latTo)*(sin((lonFrom-lonTo)/2))^2)) 167 * or 168 * d=2*asin(sqrt((sin((latFrom-latTo)/2))^2 + cos(latFrom)*cos(latTo)*(sin((lonTo-lonFrom)/2))^2)) 169 * distance = R*d 170 */ 171 172 latFrom = degreesToRadians(latFrom). it is not CLDC 1. long latTo.cos(latFrom)*MathFP. to. lonFrom) and (latTo. 175 lonTo = degreesToRadians(lonTo). 152 } 153 154 /** 155 * Calculate distance between points (latFrom.

toString(p2)). 205 206 long sqrtarg=p1 +MathFP. xxvi . 197 p1 = MathFP.toFP(1000000)).asin(asinarg).cos(lat2)*Math.toString(latFrom)). 199 200 long p2=MathFP.mul(p1.out.toString(p1)).println(" > asinarg: "+MathFP.MathFP. 216 //System.out.toString(distance)).toString(latTo)).out. 217 asinarg=MathFP.div((lonTo-lonFrom).pow(Math.out.toString(asinarg)). MathFP.cos(latTo)). 195 p1 = MathFP.cos(latFrom).println(" > asinarg: "+MathFP. 204 //System.println(" sqrtarg: "+MathFP. p2).Zarko Acimovic 179 Math. asinarg). 201 p2 = MathFP. 219 distance = MathFP.out. 203 p2 = MathFP.toString(p1)). 185 */ 186 187 /* 188 System. 207 //System.div((latFrom-latTo). 198 //System.pow(Math. 189 System.sin((lat1-lat2)/2). 202 //System.println(" distance asin: "+MathFP.toString(sqrtarg)). MathFP.mul(EARTH_RADIUS2.cos(lat1)*Math.019")*1000000 . MathFP. MathFP_2)).sin((lon2-lon1)/2).println(" p2: "+MathFP. 2) 181 + 182 Math. 213 if (sqrtarg>MathFP.mul(EARTH_RADIUS2.toString(asinarg)).println(" p1: "+MathFP. 192 */ 193 194 long p1=MathFP.print("latFrom: "+MathFP.out.sin(MathFP. 220 //System.asin approximation by X 214 // calculation is erroneus for small angles 215 long asinarg=MathFP. 221 } else { 222 //asin(X) is aproximately equall to X.print("latTo: "+MathFP.mul(MathFP.mul(p2.mul(MathFP.println(" lonFrom: "+MathFP.sqrt(sqrtarg).sqrt( 180 Math.out.out. 191 System.toFP(19000)) { //toFP("0.toFP(1000000)).out. 211 212 long distance. 208 209 sqrtarg=MathFP. sqrtarg).boundary for MathFP.toString(lonTo)).println(" p2: "+MathFP.out.toString(p2)).toString(sqrtarg)). 190 System.println(" p1: "+MathFP.mul(p1.p2).toString(lonFrom)).div(sqrtarg.out. 196 //System.sin(MathFP.println(" lonTo: "+MathFP.out.mul(p2. 210 //System. 218 //System.toFP(1000000)). 2) 183 ) 184 ). MathFP_2)).out. 223 //This approximation allow us to change the order of multiplication and division in order to reduce loss of significant digits 224 225 distance = MathFP.println(" sqrtarg: "+MathFP. p1).

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin
226
//System.out.println(" > distance: "+MathFP.toString(distance));
227
distance=MathFP.div(distance, MathFP.toFP(1000000));
228
229
}
230
231
//System.out.println(" distance: "+MathFP.toString(distance));
232
233
//if (Double.isNaN(distance)) //equivalent to (distance=0), but safer
234
// return 0;
235
return distance;
236
}
237
238
239
/**
240
* Convert degrees to radians
241
* @return value transformed to radians
242
* @param
degrees
value to be transformed to radians
243
*/
244
public static long degreesToRadians(long degrees){
245
return MathFP.div(degrees,MathFP_180DivPI);
246
}
247
248
/**
249
* Convert radians to degrees
250
* @return value transformed to degrees
251
* @param
radians
value to be transformed to degrees
252
*/
253
public static long radiansToDegrees(long radians){
254
return MathFP.mul(radians,MathFP_180DivPI);
255
}
256
257
public static final long MathFP_2 = MathFP.toFP(2);
258
public static final long MathFP_1 = MathFP.toFP(1);
259
public static final long MathFP_2PI = MathFP.mul(MathFP_2, MathFP.PI);
260
public static final long MathFP_1000 = MathFP.toFP(1000);
261
public static final long MathFP_360 = MathFP.toFP(360);
262
public static final long MathFP_180DivPI = MathFP.div(MathFP.toFP(180),
MathFP.PI);
263
public static final long MathFP_0_5 = MathFP.toFP("0.5");
264
265
266 }

xxvii

Zarko Acimovic

Class Name
MapsMIDlet
MapBackground
Outlook
DelRoute
MapObjects
CompassCanvas
PVector
Point
MathFP
ImageCanvas3
TextFormFriend
TextFormWP
TextForm
Thread4Friend
MapsMIDlet
SelectorPoint
Friend
SimpleTextForm
MapBackgroundFactory
HeapSorter
TextFormImage
Coordinates
CommaHyphenString

Maintainability
0.4696
0
0.0490881667
0.068318936
0
0.0490881667
0.068318936
0.2540449746
0.0981763335
0.0490881667
0.068318936
0.2049568079
0.1366378719
0.1174071027
0.4696284108
0
0.0490881667
0.068318936
0.2049568079
0.1857260387
0.1366378719
0.1366378719
0.1366378719

CBO
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

CYC_Classes
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

DAC
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

DIT ILCOM LCOM
0
2
75
0
4
480
0
1
3
0
1
0
0
1
311
0
1
0
0
3
255
0
10
1164
0
1
732
0
1
0
0
2
0
0
10
112
0
5
67
0
3
37
0
2
75
0
1
70
0
3
20
0
3
11
0
1
0
0
0
169
0
3
40
0
4
68
0
0
25

Complexity
Size
Lines of Code (LOC)
Interface Complexity
Number of Attributes and Methods (SIZE2)
Number Of local Methods (NOM)
Structural Complexity
xxviii

LD
0.9909
1.923
0.9
1
1
0.864
1
1.3
0.875
1
0
0
0
1
0.991
1
1
0
0
0
0
0.285
0

LEN
10
13
7
8
10
13
7
5
6
12
14
10
8
13
10
13
6
14
20
10
13
11
17

LOC
1356
616
103
23
370
291
313
699
440
52
52
175
103
173
1356
520
50
70
32
125
75
266
80

LOD_Class MPC
0.667
152
0.29
27
0.917
19
0.75
0
0.4
54
1
78
0.334
25
0.18
33
0.86
0
1
5
0.33
0
0.077
0
0.67
2
0.875
5
0.67
152
0.381
90
0.889
1
0.5
0
0.5
1
0.929
0
0.556
0
0
31
0.167
0

NAM
134
77
21
5
41
26
21
60
46
3
7
23
16
16
134
28
12
11
2
13
11
21
6

NOC
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

NOM
11
30
11
3
29
3
17
38
34
2
5
12
11
7
11
20
8
7
1
13
8
10
5

RFC
95
40
27
3
53
14
32
45
34
6
5
12
12
11
95
63
9
7
1
13
8
20
5

TCC
0.1429
0.207
0.436
0
0.29
1
0.037
0.074
0.16
1
0.4
0.03
0.145
0.048
0.143
0.36
0.25
0.29
0
0
0.107
0.083
0

WMC
142
59
20
3
70
13
40
51
95
6
5
12
11
18
142
71
9
7
1
27
8
16
13

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin

McCabe Cyclomatic Complexity (CC)
Weighted Method Count (WMC)
Response For a Class (RFC)

Architecture and Structure
Inheritance
Depth of Inheritance Tree (DIT)
Number Of Children (NOC)
Coupling
Afferent Coupling (Ca)
Coupling Between Objects (CBO)
Change Dependency Between Classes (CDBC)
Change Dependency Of Classes (CDOC)
Efferent Coupling (Ce)
Coupling Factor (CF)
Data Abstraction Coupling (DAC)
Instability (I)
Locality of Data (LD)
Message Passing Coupling (MPC)
Package Data Abstraction Coupling (PDAC)
Cohesion
Lack of Cohesion in Methods (LCOM)
Improvement of LCOM (ILCOM)
Tight Class Cohesion (TCC)

Design Guidelines and Code Conventions
Documentation
Lack Of Documentation (LOD)
Code Conventions

xxix

10 this.java class source code 1 /** 2 * 3 * DelRoute is used when deleting route 4 */ 5 public class DelRoute { 6 int index. 7 int routeID. 21 } 22 23 } xxx .routeID = routeID. 11 } 12 int getIndex(){ 13 return index.index = index. 14 } 15 int getRouteID(){ 16 return routeID.Zarko Acimovic DelRoute class seems to be perfect  DelRoute. 8 DelRoute(int index. 17 } 18 19 public String toString(){ 20 return "ID Route is "+routeID+"\n"+"Index of element to delet is "+index. int routeID){ 9 this.

991 1 1 0 0 0 0 0.207 0.923 0.068318936 0 0.0490881667 0.107 0.0490881667 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .2540449746 0.3 0.1857260387 0.875 5 0.75 0 0.145 0.074 0.1174071027 0.0490881667 0.068318936 0.25 0.037 0.5 0 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) xxxi LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.2049568079 0.0490881667 0.068318936 0.1366378719 0.29 27 0.18 33 0.889 1 0.16 1 0.9 1 1 0.4 54 1 78 0.068318936 0.381 90 0.048 0.556 0 0 31 0.875 1 0 0 0 1 0.67 152 0.334 25 0.864 1 1.4696284108 0 0.33 0 0.0981763335 0.5 1 0.03 0.29 1 0.29 0 0 0.36 0.436 0 0.1366378719 0.4 0.67 2 0.86 0 1 5 0.143 0.667 152 0.077 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.929 0 0.917 19 0.2049568079 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.9909 1.1429 0.1366378719 0.4696 0 0.

Structure and content of the comments are ignored. String resource.html Friend. considering one class comment and a comment per method as optimum.java source code 1 2 3 4 5 6 7 8 9 10 /** * * Friend class holds all important data for a friend */ public class Friend { String name.Zarko Acimovic Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions Friend class has problem with Lack of Documentation. http://www. int hashThread. Lack Of Documentation Description.se/compendium/node121. Thread4Friend t.arisa. How many comments are lacking in a class. xxxii .

} public void setID(int hash){ hashThread = hash.name = name. } public int getHash(){ return hashThread.setFirst(). this.hashThread = hashThread. } } public void setThread(Thread4Friend t){ this.resource = resource. } public String getName(){ return name. this. String resource. } else {return true. } public void setFirst(){ t. } } xxxiii . } public String toString(){ return "Friend is "+name+"\n"+"Hash is "+hashThread.t = t. } public boolean getThread(){ if (t==null){ return false. } public String getResource(){ return resource.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 11 Friend(String name.t = t. Thread4Friend t){ 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 this. int hashThread. this.

0981763335 0.074 0.875 1 0 0 0 1 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.929 0 0.29 0 0 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .436 0 0.18 33 0.75 0 0.1366378719 0.1429 0.556 0 0 31 0.33 0 0.67 152 0.5 0 0.4696284108 0 0.2049568079 0.36 0.334 25 0.068318936 0.068318936 0 0.25 0.5 1 0.2049568079 0.077 0 0.917 19 0.03 0.207 0.889 1 0.1174071027 0.145 0.037 0.9 1 1 0.3 0.9909 1.381 90 0.864 1 1.991 1 1 0 0 0 0 0.67 2 0.0490881667 0.4696 0 0.107 0.2540449746 0.0490881667 0.1366378719 0.0490881667 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.875 5 0.86 0 1 5 0.4 54 1 78 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) xxxiv LD 0.1857260387 0.143 0.16 1 0.068318936 0.4 0.068318936 0.29 1 0.923 0.048 0.29 27 0.667 152 0.1366378719 0.0490881667 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions xxxv .

considering one class comment and a comment per method as optimum. A=setHeapWithSize(A.length-1). heapify(AS. How many comments are lacking in a class.length).out.Zarko Acimovic HeapSorter class has problem with LD.html HeapSorter. i--){ a[i-1]=A[0].1). i--){ as[i-1]=AS[0]. AS[0]=AS[i-1]. i++){ System. } public void heapsort(String[] as){ String[] AS = setHeapWithSize(as. TCC and LOD: Lack Of Documentation Description. } a[0]=A[0]. i<A.length.out.length.length-1).println(AS[i]). That is the relative number of directly connected public methods in the class. AS=setHeapWithSize(AS.se/compendium/node121.arisa.1). } for(int i=as. Structure and content of the comments are ignored.println(A[i]).length. } as[0]=AS[0].length). i<AS.A. i>1. for(int i=0. i++){ System. http://www.html Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class. for(int i=0.se/compendium/node118.a. Classes having a low cohesion indicate errors in the design. http://www.arisa. heapify(A.AS. A[0]=A[i-1]. buildHeap(AS).as.java source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 /** * * HeapSorter class sorts points by distance or by name */ public class HeapSorter{ HeapSorter(){} public void heapsort(long[] a){ long[]A = setHeapWithSize(a. } for(int i=a. buildHeap(A). i>1. xxxvi .length.

length/2. } public void buildHeap(String[] as){ for(int i=as. }else{ largest=i. if(l<=heapSize(as) && as[l-1]. i>0. } } public void int int int heapify(String[]as.length/2.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 1]=tmp. } if(largest!=i){ //exchange a[i]. largest. } if(r<=heapSize(as) && as[r-1]. } if(largest!=i){ //exchange a[i]. r=right(i). int i){ l=left(i). } if(r<=heapSize(a) && a[r-1]>a[largest-1]){ largest=r. largest. i>0. a[i-1]=a[largest-1]. i--) heapify(as. a[largest] xxxvii .i). }else{ largest=i.charAt(0)>as[i-1]. if(l<=heapSize(a) && a[l-1]>a[i-1]){ largest=l. a[largestheapify(a.i). 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 1]. } public void int int int heapify(long[]a.charAt(0)){ largest=l. i--) heapify(a.charAt(0)){ 79 80 81 82 83 } public void buildHeap(long[] a){ for(int i=a. r=right(i). a[largest] long tmp=a[i-1].charAt(0)>as[largestlargest=r. int i){ l=left(i).largest).

int heapSize(String as[]){ return as. i++){ k[i]=m[i].largest). String[] setHeapWithSize(String[]m .Zarko Acimovic 84 as[largest-1]=tmpS. int n){ long[] k = new long[n]. } int heapSize(long a[]){ return a. } return k. int parent(int i){ return(i/2). for(int i=0. as[i-1]=as[largest-1].length. i<n. i++){ k[i]=m[i]. for(int i=0. int left(int i){ return(2*i). int n){ String[] k = new String[n]. heapify(as. String tmpS=as[i-1]. 85 86 87 } 88 89 90 public 91 92 } 93 94 public 95 96 } 97 98 public 99 100 } 101 102 public 103 104 } 105 106 public 107 108 } 109 110 public 111 112 113 114 115 116 } 117 118 public 119 120 121 122 123 124 } 125 }. long[] setHeapWithSize(long[]m . i<n. xxxviii .length. int right(int i){ return(2*i+1). } return k.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin
Class Name
MapsMIDlet
MapBackground
Outlook
DelRoute
MapObjects
CompassCanvas
PVector
Point
MathFP
ImageCanvas3
TextFormFriend
TextFormWP
TextForm
Thread4Friend
MapsMIDlet
SelectorPoint
Friend
SimpleTextForm
MapBackgroundFactory
HeapSorter
TextFormImage
Coordinates
CommaHyphenString

Maintainability
0.4696
0
0.0490881667
0.068318936
0
0.0490881667
0.068318936
0.2540449746
0.0981763335
0.0490881667
0.068318936
0.2049568079
0.1366378719
0.1174071027
0.4696284108
0
0.0490881667
0.068318936
0.2049568079
0.1857260387
0.1366378719
0.1366378719
0.1366378719

CBO
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

CYC_Classes
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

DAC
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

DIT ILCOM LCOM
0
2
75
0
4
480
0
1
3
0
1
0
0
1
311
0
1
0
0
3
255
0
10
1164
0
1
732
0
1
0
0
2
0
0
10
112
0
5
67
0
3
37
0
2
75
0
1
70
0
3
20
0
3
11
0
1
0
0
0
169
0
3
40
0
4
68
0
0
25

LD
0.9909
1.923
0.9
1
1
0.864
1
1.3
0.875
1
0
0
0
1
0.991
1
1
0
0
0
0
0.285
0

Complexity
Size
Lines of Code (LOC)
Interface Complexity
Number of Attributes and Methods (SIZE2)
Number Of local Methods (NOM)
Structural Complexity
McCabe Cyclomatic Complexity (CC)
Weighted Method Count (WMC)
Response For a Class (RFC)

Architecture and Structure
Inheritance
Depth of Inheritance Tree (DIT)
Number Of Children (NOC)
Coupling
Afferent Coupling (Ca)
Coupling Between Objects (CBO)
Change Dependency Between Classes (CDBC)
Change Dependency Of Classes (CDOC)

xxxix

LEN
10
13
7
8
10
13
7
5
6
12
14
10
8
13
10
13
6
14
20
10
13
11
17

LOC
1356
616
103
23
370
291
313
699
440
52
52
175
103
173
1356
520
50
70
32
125
75
266
80

LOD_Class MPC
0.667
152
0.29
27
0.917
19
0.75
0
0.4
54
1
78
0.334
25
0.18
33
0.86
0
1
5
0.33
0
0.077
0
0.67
2
0.875
5
0.67
152
0.381
90
0.889
1
0.5
0
0.5
1
0.929
0
0.556
0
0
31
0.167
0

NAM
134
77
21
5
41
26
21
60
46
3
7
23
16
16
134
28
12
11
2
13
11
21
6

NOC
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

NOM
11
30
11
3
29
3
17
38
34
2
5
12
11
7
11
20
8
7
1
13
8
10
5

RFC
95
40
27
3
53
14
32
45
34
6
5
12
12
11
95
63
9
7
1
13
8
20
5

TCC
0.1429
0.207
0.436
0
0.29
1
0.037
0.074
0.16
1
0.4
0.03
0.145
0.048
0.143
0.36
0.25
0.29
0
0
0.107
0.083
0

WMC
142
59
20
3
70
13
40
51
95
6
5
12
11
18
142
71
9
7
1
27
8
16
13

Zarko Acimovic

Efferent Coupling (Ce)
Coupling Factor (CF)
Data Abstraction Coupling (DAC)
Instability (I)
Locality of Data (LD)
Message Passing Coupling (MPC)
Package Data Abstraction Coupling (PDAC)
Cohesion
Lack of Cohesion in Methods (LCOM)
Improvement of LCOM (ILCOM)
Tight Class Cohesion (TCC)

Design Guidelines and Code Conventions
Documentation
Lack Of Documentation (LOD)
Code Conventions

ImageCnavas3 lacks documentation. Lack Of Documentation Description. How many comments are lacking in a
class, considering one class comment and a comment per method as optimum. Structure and content of the
comments are ignored. http://www.arisa.se/compendium/node121.html
ImageCanvas3.java source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14

/**
*
* ImageCanvas3 draws elements on screen and captures events on canvas
*/
//import java.io.IOException;
import javax.microedition.lcdui.*;
//import java.util.*;
public class ImageCanvas3 extends Canvas {
Outlook ol;
ImageCanvas3(Outlook ol){
xl

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

this.ol =ol;
ol.setCanvasWH(this.getWidth(),this.getHeight());
}
public void paint(Graphics g) {
ol.drawOutlook(g);
}
public void keyPressed (int keyCode){
//keyCode+=disabler;
if(keyCode==49){
ol.ZoomIn();
repaint();
}
if(keyCode==50){
ol.ZoomOut();
repaint();
}
if(keyCode==51){
repaint();
}

switch (getGameAction(keyCode)) {
case Canvas.UP:
ol.setMap('u');
repaint();
break;
case Canvas.DOWN:
ol.setMap('d');
repaint();
break;
case Canvas.LEFT:
ol.setMap('l');
repaint();
break;
case Canvas.RIGHT:
ol.setMap('r');
repaint();
break;
}
}
}

xli

667 152 0.864 1 1.1174071027 0.36 0.048 0.334 25 0.923 0.875 5 0.16 1 0.0490881667 0.889 1 0.29 0 0 0.145 0.5 1 0.2540449746 0.3 0.0981763335 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.1857260387 0.9909 1.068318936 0.1366378719 0.25 0.436 0 0.4 0.2049568079 0.068318936 0.037 0.29 27 0.143 0.1429 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) xlii LD 0.2049568079 0.18 33 0.556 0 0 31 0.4696284108 0 0.068318936 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.29 1 0.4 54 1 78 0.86 0 1 5 0.67 2 0.03 0.5 0 0.1366378719 0.991 1 1 0 0 0 0 0.107 0.068318936 0 0.0490881667 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .207 0.0490881667 0.33 0 0.67 152 0.1366378719 0.077 0 0.9 1 1 0.0490881667 0.75 0 0.4696 0 0.929 0 0.917 19 0.381 90 0.074 0.875 1 0 0 0 1 0.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions MapBackground class seems to be well designed class. xliii .

Zarko Acimovic MapBacground. 7 import javax. 6 import java.lcdui.util.microedition. 34 35 /** Float-point value of lower limit 36 */ 37 private long downLat. 29 30 31 /** Float-point value of upper limit 32 */ 33 private long upLat. 38 39 /** Side of upper limit 40 */ 41 //private char upNS. 8 9 10 public class MapBackground { 11 12 /** Current JPEG Background of map 13 */ 14 private Image img.*. 17 */ 18 private Image[] zoomImg = new Image[3]. 42 43 /** Side of lower limit 44 */ xliv . zoom out or pan 4 */ 5 import java. 21 22 /** Width of current background image 23 */ 24 private long sizeX.java source code 1 /** 2 * 3 * MapBackground transforms map according to user actions.*.*. 25 26 /** Height of current background image 27 */ 28 private long sizeY. 15 16 /** Images for Different Zoom Levels. zoom In.io. 19 20 private int zoomLevel = 0.

/** Integer value of latitude seconds of upper limit */ private long dwSlat. /** Integer value of latitude degrees of lower limit */ private long dwDlat. /** Side of left limit */ //private char leftWE. xlv . /** Integer value of latitude seconds of upper limit */ private long upSlat. /** Integer value of latitude degrees of upper limit */ private long upDlat.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 //private char downNS. /** Integer value of latitude minutes of upper limit */ private long upMlat. /** Integer value of longitude degrees of left limit */ private long lfDlon. /** Side of right limit */ ///private char rightWE. /** Integer value of latitude minutes of lower limit */ private long dwMlat. /** Float-point value of left limit */ private long leftLon. /** Float-point value of right limit */ private long rightLon. /** Integer value of longitude minutes of left limit */ private long lfMlon.

/** Integer value of longitude minutes of right limit */ private long rtMlon. /** new upper left edge due to pan or Zoom. /** Scale of map */ private long scale. /** World coordinates of Down end of Image */ xlvi .Zarko Acimovic 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 /** Integer value of longitude seconds of left limit */ private long lfSlon. /** Integer value of longitude seconds of right limit */ private long rtSlon. /** Number of lon-seconds per pixel */ private long pixLon. /** Total number of Longitude seconds for left limit point */ long totLonSec . * newEdge represents Point of upper left corner of visible screen */ Point previousEdge. /** new upper left edge due to pan or Zoom. /** Integer value of longitude degrees of right limit */ private long rtDlon. /** Number of lat-seconds per pixel */ private long pixLat. /** Total number of Latitude seconds for upper limit point */ long totLatSec . * newEdge represents Point of upper left corner of visible screen */ Point newEdge.

/** y-coordinate of begining of image */ long y = 0. /** Indicates beginning of pan range horizontaly */ boolean reachBeginH = true. /** Counter of shifts horizontally */ long movH=0. /** Indicates end of pan range verticaly */ boolean reachEndV = false. /** Indicates beginning of pan range verticaly */ boolean reachBeginV = true. /** x-coordinate of begining of image */ long x = 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 Point downEnd. /** Counter of shifts vertically */ long movV=0. /** Canvas Width xlvii . /** Indicates end of pan range horizontaly */ boolean reachEndH = false. /** Step of panning */ long step = 30. /** Canvas Height */ private long canvasHeight. /** Name of smallest image */ String[] imgArray = new String[3]. /** Character that represents side of Pan */ char sidePan.

214 String latStr2.toString(upLat). 215 String lonStr2 ) { 216 if(MathFP.toFP(lonStr2)){ 225 this.toFP(latStr2)){ 217 this.upLat = MathFP.toString(leftLon). 218 this.getWidth(). 246 xlviii .toFP(lonStr2).false).toFP(latStr2). 206 long minY."". 230 } 231 232 233 imgArray[0] = name0. 219 } else { 220 this. 212 String latStr1. 242 sizeX = img.upLat = MathFP. 236 237 try { 238 zoomImg[0] = Image.toFP(lonStr1)."blanco". String name1. 203 long previousPixLon. String name2.toFP(latStr1).leftLon = MathFP.downLat = MathFP. 200 201 202 long previousPixLat. 221 this.toFP(latStr1). 244 245 newEdge = new Point(MathFP.downLat = MathFP.createImage(imgArray[0]).Zarko Acimovic 198 */ 199 private long canvasWidth. 235 imgArray[2] = name2. 209 210 211 MapBackground( String name0. 207 208 boolean param = false.leftLon = MathFP. 222 } 223 224 if(MathFP.getHeight().toFP(latStr1)>MathFP."newEdge". 226 this. 243 sizeY = img. 213 String lonStr1.rightLon = MathFP.toFP(latStr2). 227 } else { 228 this. 229 this.MathFP. 204 205 long minX.rightLon = MathFP. 239 } catch (IOException e) {} 240 241 img = zoomImg[0].toFP(lonStr1). 234 imgArray[1] = name1.toFP(lonStr1)>MathFP.toFP(lonStr2).

upLat."".setPixels(). 248 249 this. 271 } 272 273 /** Sets pixels as Float-Point when main constructor is called 274 * and when Zoom In/Out is applied 275 */ 276 public void setPixels(){ 277 long pxy1 = MathFP.toString(rightLon).mul(MathFP."blanco".MathFP.toFP(sizeX)). 264 } 265 266 /** Returns number of latitude seconds per pixel 267 * @return int 268 */ 269 public long getPixLat(){ 270 return pixLat. 251 252 253 this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 247 downEnd = new Point(MathFP. 290 } 291 xlix .toFP("3600")).totLonSec = MathFP. 250 this.toString(downLat). 279 280 long pxy2 = MathFP. 281 pixLat = MathFP.mul(MathFP.MathFP.div(pxy2. 254 } 255 256 257 258 /** Returns number of longitude seconds per pixel 259 * @return int 260 * 261 */ 262 public long getPixLon(){ 263 return pixLon.leftLon).fals e).MathFP. 282 } 283 284 /** Returns image to draw 285 * 286 * @return Image 287 */ 288 public Image getImage(){ 289 return img.toFP("3600")).leftLon.totLatSec = MathFP.toFP("3600")).sub(rightLon.mul(this.MathFP.MathFP.MathFP.MathFP.downLat)."downEnd".div(pxy1.toFP(sizeY)).mul(this. 278 pixLon = MathFP.sub(upLat.toFP("3600")).

332 333 long tt1 = MathFP.getLatSec()."".mul(this.totLatSec.tt1).getPixLon()."".getLonSec().toFP(Math.MathFP. 298 } 299 300 /** Returns total number of seconds for UPPER LATITUDE 301 * @return int 302 */ 303 public long getLatSec() { 304 return this. 322 } 323 324 /** Sets newEdge.toFP(Math.sub(this. 305 } 306 307 308 /** Returns Canvas height 309 * 310 * @return int 311 */ 312 public long getCanvasHeight(){ 313 return canvasHeight.Zarko Acimovic 292 293 /** Returns total number of seconds for LEFT LONGITUDE 294 * @return int 295 */ 296 public long getLonSec() { 297 return this. 337 MathFP.tt2).mul(this.getPixLat(). l . 325 * newEdge represents Point of upper left corner of visible screen (x=0 and 326 * y=0 for newEdge) 327 * 328 * @return Point 329 */ 330 public void setNewEdge(){ 331 previousEdge = newEdge. 314 } 315 316 /** Returns Canvas width 317 * 318 * @return int 319 */ 320 public long getCanvasWidth(){ 321 return canvasWidth. 335 336 newEdge = new Point(MathFP.totLonSec. new Edge is created every time when user pans or zooms map .abs(this.abs(this. 334 long tt2 = MathFP.getY()))).add(this.MathFP.false).getX()))).

if(movV==0) reachBeginV=true. } } if (side=='l'){ if(reachBeginH==false){ li . } /** Sets map due to Pan transformation * */ public void setMap(char side){ if (side=='u'){ if(reachBeginV==false){ y+=((this. } /** Returns new Edge as String * * @return String */ public String getNEdgeStr(){ return newEdge. if(y>0) y=0. movV--. if(movV==step) reachEndV=true.getHeight()-canvasHeight)/step). } reachEndV=false.getHeight() .toString().canvasHeight)/step). reachBeginV=false. movV++.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 } /** Returns new edge */ public Point getNewEdge(){ return newEdge. } /** Returns down End */ public Point getDownEnd(){ return downEnd.img.img. } if (side=='d'){ if(reachEndV==false){ y-=((this.

431 this. 429 if(zoomLevel<2){ 430 zoom = true.Zarko Acimovic 389 x+=((this.setNewEdge(). 394 } 395 396 } 397 398 if (side=='r'){ 399 if(reachEndH==false) { 400 x-=((this. 391 movH--. 392 reachEndH=false.getWidth()-canvasWidth)/step). 393 if(movH==0) reachBeginH=true. 423 } 424 425 /** Zoom In 426 */ 427 public boolean ZoomIn(){ 428 boolean zoom = false. 404 405 } 406 } 407 408 this. 417 } 418 419 /** returns y-coordinate of begining of Image 420 */ 421 public long getY(){ 422 return y. 409 410 } 411 412 413 /** returns x-coordinate of begining of Image 414 */ 415 public long getX(){ 416 return x.createImage(imgArray[zoomLevel]). 390 if(x>0) x=0. 437 } catch(Exception e){} 438 } lii .getWidth()-canvasWidth)/step). 432 433 zoomLevel++. 403 if(movH==step) reachEndH=true. 402 reachBeginH=false.img. 434 if (zoomImg[zoomLevel]==null){ 435 try{ 436 zoomImg[zoomLevel] = Image. 401 movH++.img.setPreviousEdge().

} return zoom.setPixels().img. this. } /** Draws Layout */ liii . x=0-(((this. this.img.sizeX = this.setPreviousEdge(). zoomLevel--.getHeight(). y=0-(((this.setNewEdge(). this.sizeX = this.img = zoomImg[zoomLevel].img.getHeight().setNewEdge(). this. x=0-(((this.img = zoomImg[zoomLevel]. this. y=0-(((this.getWidth().img.img.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 this.img. if(zoomLevel>0){ zoom = true.sizeY = this. this. } /** Increments Pan level */ public void incPan(Vector v){ if (step<10) step++.getHeight()-canvasHeight)/step)*movV). } /** Zoom Out */ public boolean ZoomOut(){ boolean zoom = false. this.setPixels().getHeight()-canvasHeight)/step)*movV). this. this. this.getWidth()-canvasWidth)/step)*movH).img. } return zoom.sizeY = this.getWidth()-canvasWidth)/step)*movH).getWidth(). } /** Decrements Pan level */ public void decPan(Vector v){ if (step>3) step--.img.

int canvasHeight){ this. g.canvasHeight = (long)canvasHeight. previousPixLat = pixLat.toString()). previousPixLon = pixLon. } /** Set Canvas width and height */ public void setCanvasWH(int canvasWidth. } public long getPreviousPixLat(){ return previousPixLat.xx. } public long getStep(){ return step. } liv . } public long imageWidth(){ return (long)img.getHeight(). } public void setPreviousEdge(){ previousEdge = newEdge.canvasWidth = (long)canvasWidth. int yy = Integer.yy. } public long getZoomLevel(){ return zoomLevel. } public long getPreviousPixLon(){ return previousPixLon.parseInt(lx. Long ly = new Long(y). } public Point getPreviousEdge(){ return previousEdge. int xx = Integer.toString()). } public long imageHeight(){ return (long)img.getWidth().0).parseInt(ly.Zarko Acimovic 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 public void drawMapBackground(Graphics g){ Long lx = new Long(x).drawImage(img. this.

div(Math.getWidth()-canvasWidth)/step).getHeight()-canvasHeight)/step).img.toLong(p1).div((this.getHeight()-canvasHeight)/step).getLatSec()this.y = 0 . 561 562 563 564 p1*=((this.getLonSec()this.getLonSec()).img.abs(imgWidth-canvasWidth).img.img. 551 552 long difLat = MathFP.getHeight()-canvasHeight)/step).getHeight()canvasHeight). 585 586 if(x<minX){ 587 x=minX. // y value of screen begining 580 581 582 583 movV = p1/((this.getWidth(). 575 }*/ 576 577 578 this.div(difLon.getLatSec()).getWidth()-canvasWidth)/step). // x value of screen begining 579 this.div((this.img.step)).img.x = 0 . 549 minX = -Math.img.pixLat).img.p2.img.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 541 542 /** Sets Background for selected Point 543 * Used in SelectorPoint.selectWP 544 */ 545 public void setBackground(Point ww){ 546 547 long imgWidth = (long) this.img. 556 557 p1 = MathFP.img.p1.getWidth()-canvasWidth)/step).getWidth()-canvasWidth)/step).div(difLat. 558 p2 = MathFP. 570 p2-=((this.MathFP.getHeight().toLong(p2).img. lv . 560 p2--. 548 long imgHeight= (long) this. //y pixel of ww 554 long p1 = MathFP.pixLon).getHeight()-canvasHeight)/step).step)).getWidth()-canvasWidth)/step). 571 572 p1 -=((this. 559 p1--. //x pixel of ww 553 long difLon = MathFP.getWidth()canvasWidth). 565 p2*=((this.abs(ww. 550 minY = -Math. 566 567 /** 568 if(param==true) { 569 p1 -=((this.MathFP. 584 movH = p2/((this.abs(imgHeight-canvasHeight).abs(ww. 573 p2-=((this.img.div(Math. 555 long p2 = MathFP. 574 p2-=((this.

getHeight()-canvasHeight)/step).img. if(y>0) y=0. } if(x>0) x=0. p2+=((this.getWidth()-canvasWidth)/step).} else {reachEndH=false. if(movH<0) movH=0.} else {reachEndV=false.img. p1 -=((this.} (movV==0) {reachBeginV=true. p2+=((this. p2+=((this.} else {reachBeginH=false. p2+=((this. if if if if (movV==step) {reachEndV=true.} (movH==step) {reachEndH=true.getWidth()-canvasWidth)/step). } /** public void stela(long p1.} (movH==0) {reachBeginH=true.Zarko Acimovic 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 movH=step.setNewEdge().getWidth()-canvasWidth)/step). } if(y<minY){ y=minY.img.} else {reachBeginV=false. if(movV<0) movV=0.getWidth()-canvasWidth)/step).img. }*/ } lvi . movV=step.long p2){ p1 -=((this.img.img.getHeight()-canvasHeight)/step).} this.

0490881667 0.18 33 0.929 0 0.0490881667 0.29 0 0 0.36 0.556 0 0 31 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.875 5 0.33 0 0.107 0.3 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .875 1 0 0 0 1 0.074 0.068318936 0.2049568079 0.9 1 1 0.2049568079 0.068318936 0.381 90 0.667 152 0.1857260387 0.03 0.1174071027 0.5 1 0.207 0.29 1 0.4 0.991 1 1 0 0 0 0 0.9909 1.0490881667 0.436 0 0.67 152 0.16 1 0.077 0 0.1429 0.145 0.86 0 1 5 0.048 0.334 25 0.889 1 0.068318936 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.917 19 0.25 0.0981763335 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) lvii LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.864 1 1.037 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.068318936 0 0.0490881667 0.1366378719 0.4 54 1 78 0.1366378719 0.5 0 0.67 2 0.4696 0 0.923 0.1366378719 0.143 0.29 27 0.4696284108 0 0.2540449746 0.75 0 0.

Zarko Acimovic Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions Problem with MapBackgroundFactory is Length of class name (LEN).java source code 1 /** 2 * 3 * Different map formats could be implemented and dealt with with MapBackgroundFactory 4 */ 5 public class MapBackgroundFactory { 6 7 MapBackground m. String name2. MapBackgroundFactory. 8 9 /** 10 MapBackgroundFactory(String name0. lviii . String name1.

2540449746 0. String lon1.4696 0 0. int sLon2. String name1.991 1 1 0 0 0 0 0.name1.143 0. int sLat2. int scale){ 15 16 //m = new MapBackground(name0.068318936 0.889 1 0.037 0.36 0.1366378719 0.0490881667 0. 24 lat1.33 0 0.0490881667 0. 14 int dLon2.145 0.381 90 0.sLon2.077 0 0.mLon1. 25 } 26 27 28 public MapBackground getMapBackground(){ 29 return m.048 0. 30 } 31 32 } Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.923 0. char sdNS2.67 152 0.0490881667 0. int sLat1.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .5 0 0. int mLat1.9909 1.sdNS2.285 0 Complexity Size lix LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.068318936 0.068318936 0.name1.667 152 0.29 1 0.29 0 0 0.sdWE2. int sLon1.sdWE1. scale).25 0.16 1 0.mLon2.lat2.lon2).074 0.mLat1.1174071027 0.1366378719 0.4696284108 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.068318936 0 0.436 0 0.1366378719 0. 13 int dLat2. char sdWE1.sLat1.0981763335 0.sLat2.1429 0. char sdNS1.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0. String lon2){ 23 m = new MapBackground(name0.5 1 0.lon1.sLon1. String name2.name2.18 33 0. int mLon1.4 54 1 78 0.mLat2. 19 }*/ 20 21 MapBackgroundFactory(String name0.864 1 1.75 0 0.dLon1.556 0 0 31 0.334 25 0.4 0.03 0.1857260387 0.929 0 0.875 5 0.name2.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 11 int dLat1. String lat2.2049568079 0.3 0.86 0 1 5 0.dLon2.9 1 1 0. 22 String lat1.sdNS1.29 27 0. char sdWE2.207 0. 18 dLat2. 17 dLat1.875 1 0 0 0 1 0. int mLon2. 12 int dLon1.917 19 0.0490881667 0. int mLat2.2049568079 0.107 0.67 2 0.

Zarko Acimovic Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) lx .

getNewEdge(). destinationPosition. //import java.java source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 /** * * MapObjects controls appearance of all map objects on current screen */ import java.lcdui. boolean drawLine = false. Point destinationPosition.getNewEdge(). boolean destSet = false.io. public class MapObjects { MapBackground mb. PVector freeWaypoints.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions MapObjects seem to be well designed class. import javax.setName("dummy"). MapObjects. Hashtable friends. destinationPosition = mb. Vector routes. Point previousPosition. routes = new Vector(). MapObjects(MapBackground mb){ this.microedition. friends = new Hashtable().setName("dummy").*. Vector drawablePoints. Point currentPosition.mb = mb. PVector currentRoute. currentPosition = mb.util.*.*. currentPosition. lxi . boolean currentSet = false.

getPixLat()). mb.getNewEdge().addElement(wp).getDownEnd())) { 45 currentPosition. mb. 71 temp1. 42 43 //check if current and destination are visible 44 if(this.getNewEdge(). 50 temp1.mb.setXY(mb.elementAt(i). 57 wp.getNewEdge().addElement(currentPosition).setXY(mb. j<temp2.destinationPosition.mb.getDownEnd()). 67 68 for (int j=0.mb.check(mb.getPixLon().getPixLon(). 41 Vector temp2.size(). j++){ 56 Point wp = (Point)temp2.getDownEnd()). 72 } 73 } 74 } 75 drawablePoints = temp1. 70 wp.getDownEnd())) { 49 destinationPosition.getPixLon(). 65 if (v.setXY(mb. 46 temp1.getVisible()==true){ 66 temp2 = v.getPoints(mb.size(). 58 temp1.getNewEdge().elementAt(j). 55 for (int j=0.mb.mb.mb. i<routes. j++){ 69 Point wp = (Point)temp2.getPoints(mb.getPixLat()).getPixLat()).getNewEdge(). i++){ 64 PVector v = (PVector)routes.mb.mb.getNewEdge().getNewEdge().mb.getNewEdge().getPixLon().elementAt(j).getPixLat()). 47 } 48 if(this.Zarko Acimovic 34 } 35 36 /** Sets drawable Points for current Screen 37 * 38 */ 39 public void setDrawablePoints(){ 40 Vector temp1 = new Vector().setXY(mb.addElement(destinationPosition). j<temp2.addElement(wp). 51 } 52 53 //check which free waypoints are visible 54 temp2 = freeWaypoints. 76 } 77 78 /** Returns drawable Points for current Screen 79 * @return Vector lxii .check(mb.mb.currentPosition. 59 } 60 61 62 //check which route points are visible 63 for (int i=0.size().

103 drawLine = false. 96 currentSet = true.setDrawablePoints().getPixLon(). 94 currentPosition = wp. 120 } 121 122 /** Reset destination position 123 */ 124 public void resetDestinationPosition(){ 125 destinationPosition = mb. 112 } 113 114 115 /** Set destination position 116 */ 117 public void setDestinationPosition(Point wp){ 118 destinationPosition = wp.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 80 */ 81 public Vector getDrawablePointsOld(){ 82 83 return drawablePoints.mb.getNewEdge(). 95 currentPosition.getNewEdge(). 119 destSet = true.getPixLat()). 105 } 106 107 /** Returns current position 108 * @return Point 109 */ 110 public Point getCurrentPosition(){ 111 return currentPosition.mb.setXY(mb. 89 } 90 91 92 public void setCurrentPosition(Point wp){ 93 previousPosition = currentPosition. 88 return drawablePoints. 128 } 129 lxiii . 84 } 85 86 public Vector getDrawablePoints(){ 87 this. 97 } 98 99 /** Reset current position 100 */ 101 public void resetCurrentPosition(){ 102 currentPosition = mb. 104 currentSet = false. 126 drawLine = false. 127 destSet = false.getNewEdge().

getXX().currentPosition.mb.destinationPosition.getName(). 141 } 142 143 /** Returns free Vector of free Points 144 */ 145 public PVector getFreeWaypoints(){ 146 return freeWaypoints.wp.mb.getNewEdge(). 162 } 163 164 // Drawing of free Points.toString()).setDrawablePoints(). 135 } 136 137 /** Returns all routes 138 */ 139 public Vector getRoutes(){ 140 return routes. i++){ 166 Point wp = (Point)drawablePoints. 170 } else { 171 Image img = null.size().getImage().getImage()). 161 g.5*zoomL. 147 } 148 149 /** Draws MapObjects --. 153 Long zzl = new Long(zl).getYY()).getPixLat()). 154 int zoomL = Integer.getPixLat()).getPixLon().wp.mb.parseInt(zzl. 167 if(wp. 172 try{ 173 img = Image. boolean route){ 152 long zl = mb.getXX().getXX()+5.wp.setXY(mb.getX X(). lxiv .drawString(wp. i<drawablePoints.equals("blanco")){ 168 g. 155 this. 169 g.5*zoomL).OBSOLETED!!! 150 */ 151 public void drawMOBold(Graphics g. 156 157 // Drawing of line beetwen destination and current position 158 if(drawLine==true){ 159 currentPosition.0).createImage(wp. 160 destinationPosition.getYY() +5.Zarko Acimovic 130 /** Returns destination position 131 * @return Point 132 */ 133 public Point getDestinationPosition(){ 134 return destinationPosition.destinationPosition.getNewEdge().setXY(mb.getYY().getPixLon().elementAt(i).drawLine(currentPosition. current position and destination position 165 for(int i=0.mb.getYY().fillRect(wp.getZoomLevel()+1.

mb.mb.getNewEdge().Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 174 }catch(Exception e){} 175 g. 209 wpv.getPixLon().size().drawVector(g.getPixLat().mb. j<wpv.mb.drawVector(g. 0). i<routes.mb.getPixLat()).getNewEdge().elementAt(j).getXX().wp1.mb.drawVector(g. 191 } 192 } 193 } 194 } 195 } 196 197 /** Draws MapObjects 198 */ 199 public void drawMOB(Graphics g.route.mb.drawImage(img.size(). 203 204 if(friends.getPixLon(). 205 206 if(route==true){ 207 for (int i =0.size()!=0) this.wp.false.0). 176 } 177 178 } 179 180 // Drawing of route 181 if(route==true){ 182 for(int i=0. 190 g.getPixLon(). i++){ 183 PVector wpv = (PVector)routes. 210 } 211 } 212 213 if(currentSet) { lxv .getPixLat().mb.getVisible()==true){ 185 for(int j=0.getNewEdge().mb.getZoomLeve l()).elementAt(i).elementAt(j+1).mb. 201 202 freeWaypoints.0.wp.elementAt(i).getXX().getYY(). j++){ 186 Point wp1 = (Point) wpv.mb.wp2.setXY(mb.setXY(mb. 189 wp2.g etZoomLevel()).getXX().mb. i<routes.getPixLon().mb.getNewEdge().size()-1.getPixLat()).getPixLon(). i++){ 208 PVector wpv = (PVector)routes.getNewEdge().mb. 184 if(wpv. boolean route){ 200 g.setColor(0.getPixLat().wp2.getFriends().false.0).mb.drawLine(wp1.getYY()). 188 wp1.getYY(). 187 Point wp2 = (Point) wpv.

getX X(). 228 } 229 230 /** Adds new route 231 */ 232 public void addRoute(PVector v){ 233 this. 253 } 254 255 /** Measure distance 256 */ 257 public long measureDistance(Point wp){ 258 if (currentPosition. 219 } 220 221 222 223 224 /** Adds free Point 225 */ 226 public void addFreeWaypoint(Point wp){ 227 this. 240 for (int i=0.getNewEdge())) { lxvi .destinationPosition.pos). i++){ 241 route = (PVector)routes.getPixLat().mb. int pos) { 239 PVector route.getYY()).routes.drawPoint(g.getID()==routeID){ 243 route.size(). 234 } 235 236 /** Adds new Point to route with routeID on position pos 237 */ 238 public void addWP2Route(Point wp. i<routes.drawPoint(g.mb.destinationPosition.mb.Zarko Acimovic 214 currentPosition. 218 if(currentSet && destSet) g.getXX().mb.mb.getPixLon().getPixLon().addElement(wp).mb.mb.drawLine(currentPosition.currentPosition.ge tZoomLevel()).getPixLat().elementAt(i).getNewEdge().freeWaypoints = wpv.freeWaypoints. 245 } 246 } 247 } 248 249 /** Sets free waypoints vector 250 */ 251 public void setFreeWaypointsV(PVector wpv){ 252 this. int routeID. 215 216 } 217 if(destSet) destinationPosition.getYY().equals(mb.mb.getZoo mLevel()). 244 i=1000. 242 if(route.addElement(v).insertElementAt(wp.getNewEdge().

} /** This is not working well lxvii . i<routes. } else { return currentPosition.measureDistance(wp).toFP("0"). } public void removeRoute(PVector wr){ routes. i++){ PVector rt = (PVector)routes. if (rt. direction = Coordinates. if(latC>latP && lonC>lonP) direction = MathFP. i=1000.toFP("90"). if(latC<latP && lonP==lonC) direction = MathFP. lonP = previousPosition. return direction. if(latP==latC && lonC<lonP) direction = MathFP. if(latP==latC && lonC>lonP) direction = MathFP. if(latC>latP && lonP==lonC) direction = MathFP.getName()==s) { routes. if(latC<latP && lonC<lonP) direction = MathFP. lonC = currentPosition.size().getLon().degreesToRadians(direction).toFP("225"). } public void removeRoute(String s){ for(int i=0.toFP("315"). if(latC<latP && lonC>lonP) direction = MathFP.removeElement(wr).getLat().toFP("135").removeElementAt(i). latP = previousPosition.elementAt(i).toFP("180"). } } } public long getDirection(){ long long long long long direction = 0.getLon(). } } public boolean currentSet(){ return currentSet.toFP("45"). } public boolean destSet(){ return destSet.getLat(). latC = currentPosition.toFP("270").Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 return -1. if(latC>latP && lonC<lonP) direction = MathFP.

330 if(MathFP. 322 if(latD>latP && lonD>lonP) bearing = MathFP.toFP("90"). 343 friends.dummy). 318 319 320 //if(latD>latP && lonD==lonP) bearing = MathFP. 326 //if(latD<latP && lonP==lonD) bearing = MathFP. 329 //if(latP==latD && lonD<lonP) bearing = MathFP. 317 long lonD = destinationPosition.sub(latD.toFP("315").sub(lonD.out. 353 System.getLon().put(friendID.toFP("5") && lonD>lonP) bearing = MathFP. 328 if(latD<latP && lonD<lonP) bearing = MathFP.toFP("5") ) bearing = MathFP.remove(frID). 348 } 349 350 public void deleteFriend(int friendID){ 351 Integer frID = new Integer(friendID). 352 friends.toFP("135"). 323 //if(latD==latP && lonD>lonP) bearing = MathFP.toFP("180").getLat(). 332 333 334 bearing = Coordinates.toFP("270").lonP))<MathFP. 314 long latP = previousPosition.abs(MathFP.latP))<MathFP. 315 long lonP = previousPosition.sub(latD. 325 if(latD<latP && lonD>lonP) bearing = MathFP.lonP))<MathFP.p).getLon().put(frID.false).toFP("0").abs(MathFP.toFP("45"). 321 if( latD>latP && MathFP. 316 long latD = destinationPosition.toFP("5") && lonD<lonP) bearing = MathFP.getLat(). 324 if(MathFP. 335 return bearing. 354 } 355 356 public void deleteAllFriends(){ lxviii .Zarko Acimovic 310 */ 311 public long getBearing(){ 312 313 long bearing = 0.abs(MathFP.sub(lonD.toFP("180"). 336 337 } 338 339 340 public void addNewFriend(int friendID){ 341 Point dummy = new Point(currentPosition. 342 Integer frID = new Integer(friendID).Point p){ 347 friends. 331 if(latD>latP && lonD<lonP) bearing = MathFP.toFP("0").toFP("225").println(friends).toFP("90").toFP("270"). 327 if(latD<latP && MathFP. 344 } 345 346 public void updateFriend(Integer friendID.latP))<MathFP.abs(MathFP.toFP("5") ) bearing = MathFP.degreesToRadians(bearing).

out. } /** Conversion of hashtable into vector */ public PVector getFriends(){ Vector v = new Vector().elements(). //System.println(friends).hasMoreElements()){ v.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 //System.out. friends. return PFriends.addElement((Point)e. Enumeration e = friends.clear(). } PVector PFriends = new PVector(v. while(e.println("YIPI YAAA YEEEEE"). } } lxix .nextElement()).false).

991 1 1 0 0 0 0 0.107 0.5 1 0.4 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.1366378719 0.334 25 0.2540449746 0.16 1 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.0490881667 0.207 0.75 0 0.36 0.9909 1.33 0 0.929 0 0.25 0.875 5 0.0981763335 0.381 90 0.068318936 0 0.1366378719 0.29 27 0.5 0 0.074 0.145 0.1429 0.2049568079 0.556 0 0 31 0.0490881667 0.068318936 0.923 0.4696 0 0.077 0 0.667 152 0.068318936 0.048 0.0490881667 0.0490881667 0.436 0 0.068318936 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .889 1 0.9 1 1 0.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.917 19 0.864 1 1.29 1 0.67 152 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) lxx LD 0.29 0 0 0.4 54 1 78 0.4696284108 0 0.86 0 1 5 0.875 1 0 0 0 1 0.1366378719 0.67 2 0.18 33 0.037 0.1174071027 0.2049568079 0.143 0.3 0.1857260387 0.03 0.

html Message Passing Coupling Description The MPC measures the number of method calls defined in methods of a class to methods in other classes.arisa. Lines of Code Description: Lines of code simply counts the lines of source code (line break characters) of a certain software entity.arisa. and therefore the dependency of local methods to methods implemented by other classes. It is a simple yet powerful metric to assess the complexity of software entities. http://www.se/compendium/node91.arisa.se/compendium/node98. Additionally it can only be measured in the source code itself from the front-end and is therefore a frontend side metric. http://www. Since it is depending on code conventions and format. It allows for conclusions on the message passing (method calls) between objects of the involved classes. It is parameterized by a way to compute the weight of each method. it is critical to use it in generated codes since it may lack of line breaks. maintenance and testing effort.html Response For a Class Description Count of (public) methods in a class and methods directly called by these.html Weighted Method Count Description A weighted sum of methods implemented within a class.se/compendium/node113. RFCis only applicable to objectoriented systems. This allows for conclusions on reuseability. Possible weight metrics are: lxxi . http://www.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions MapsMIDlet class has problem with Lines of Code.

32 lxxii .microedition. it can easily adapted to non-object-oriented systems computing the weighted sum of functions implemented within a module or file. 27 Outlook oul. 21 "44. 25 MapObjects mob. 9 10 import java. This variant of WMC uses McCabe Cyclomatic Complexity 3. Originally defined as an object-oriented metric. "20.1. 31 CompassCanvas cc."/Veliki.*.Zarko Acimovic McCabe Cyclomatic Complexity 3.se/compendium/node97. Lines of Code 3.48713523"). 11 import java.util.png". 30 ImageCanvas3 ic.1.lcdui.Runnable { 18 19 20 MapBackgroundFactory mbf = new MapBackgroundFactory("/Mali2.1.png".79241639".java 1 /** 2 * 3 * MapsMIDlet creates control menus due to user's actions and handles GPS issues 4 * 5 */ 6 import javax.html MapsMIDlet. 28 29 PVector vwpF = new PVector("free". "20.83049905". 26 SelectorPoint selP.44570857".1.arisa.3 metric for calculating the weight for each method.false).3. http://www. "44.*.midlet.*.microedition. 22 23 24 MapBackground mb. 12 13 14 15 16 17 public class MapsMIDlet extends MIDlet implements CommandListener.png".*. 7 8 import javax. 1 (unweighted WMC). "/Srednji.io.

"/Service_or_Utility/Cinema.80466556".2 . 50 51 52 53 54 /** Point wp3 = new Point(45."/Service_or_Utility/Cinema.80865126".81248939"."/Cultural_or_Tourist/Event .png".45.45417165"."20.true).23.17. 58 Point wp7 = new Point(46.'E'.'E'.true). 61 Point wp10 = new Point(46."j".'N'."j".20.46743470". 5.81573706".true).'E'.45459270". 64 Point wp13 = new Point(45.45661377".80496078".15. 57 Point wp6 = new Point(46."j".46132951".png"."f1".21.33. 5. 5."Grinet kafe".'N'.21.82518476".'N'. 0.39.png".27.'N'. maj"."j")."/Service_or_Utility/Pharmacy.png"."j".20. 9."j". 48 Point wp14 = new Point("44."j".58.8178034".45943480".png"."j"). 49 Point wp15 = new Point("44.20.'E'.20."j"."/Sport/Swimming."20.21.50.'N'. 44 Point wp10 = new Point("44.png". Knezu Mihailu"."Klub'Akademija'".'N'."/Service_or_Utility/Cafe.29.23.45.png". 60 Point wp9 = new Point(46.48."Urgentni centar".'N'."j"."j"). 63 Point wp12 = new Point(46.13."j")."20. 56 Point wp5 = new Point(46. 38 Point wp5 = new Point("44.29.22.true) ."e1". 9.50."/Cultural_or_Tourist/Church.59.81854182"."d".png"."e".'N'.15.20. 1.46368736"."c". 42 Point wp8 = new Point("44. 0."Policija"."/Service_or_Utility/Redcross.png"."Bioskop REX".'E'.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 33 //Point wp3 = new Point("44. 9."20.82990854". 59 Point wp8 = new Point(46.82577520"."f". 45 Point wp11 = new Point("44.true).true)."g1"."25.'N'."j").'N'.t rue).'E'.true).oktobar".png"."Filoloski fakultet".10."/Service_or_Utility/School.20.true)."j"."20."RCUB".26."d1"."j"."20."Saborna crkva".15."20.23.'E'. true)."j").22."j". 36 37 Point wp4 = new Point("44.png"."20."c1". 39 40 Point wp6 = new Point("44. 41 Point wp7 = new Point("44.81293225"."20."j").png"."Elektrotehnicki fakultet".true).20.42."Zooloski vrt".80067980".47652941". 43 Point wp9 = new Point("44."j"."/Service_or_Utility/Shop."20."20."j")."/Service_or_Utility/School."/Cultural_or_Tourist/Zoo.50. 1.45711898". 0.81916183". 2."Apoteka".48."20.png".true).png".'E'.true).81426084".'E'."a"."j".'N'. 35 Point wp1 = new Point("44.20."j".true). lxxiii .81293225"."Bioskop 20.23."/Cultural_or_Tourist/Monument.'E'.46006637"."20.25.45737165".47337150".png"."/Service_or_Utility/School."b".true).30."/Service_or_Utility/Police. 34 Point wp2 = new Point("44."j")."j").45737165"."Sp. 47 Point wp13 = new Point("44."j".45998215"."20. 46 Point wp12 = new Point("44.30."j").'E'."Trzni centar 'Sremska'"."20.45177167". 55 Point wp4 = new Point(45. 62 Point wp11 = new Point(46.

85 86 87 88 Command opt."g". 82 Command selectCmd.46.20.'N'. 0.20.35. 76 Command DELIM.'N'. 78 79 Display d = Display.'E'.'N'. 0. 68 Point wp17 = new Point(46. 112 int gpsHash = 0. 101 Thread t2."j").20. 77 Command MAP_CMD. 66 Point wp15 = new Point(46. 111 List gpsList."h".'N'. 113 114 int gpsThr = 0. 95 Command friends. 105 static String show = "". 104 boolean gpsON = false.10. lxxiv . 109 Command onGPSc.23.20.54. 106 boolean first = false. 67 Point wp16 = new Point(46. 83 Command mapviewCmd. 84 Command compassCmd. 97 Command ZoomOut. 107 List friendList. 99 SimpleTextForm gpsTf. 110 Command offGPSc.23. 0.50.MENUS. 89 Command mod. 69 Point wp18 = new Point(45. 96 Command ZoomIn.20.20. 93 Command routes.getDisplay(this).23. 72 73 74 ///////////////////////COMMANDS. 80 81 List modes.'E'.'E'. */ 70 71 Point selectedWP.23."j"."j").48."j").52.23. 94 Command gps.25.BUTTONS\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 75 Command DUMMY.30."i". 9. 90 91 List MVList. 100 Thread t1.'N'. 98 Command exitCmd. 0. 108 Command addNewFriend . 92 Command Points. 102 103 static String resource="".'E'."k"."j").Zarko Acimovic 65 Point wp14 = new Point(46.'E'."j").

//form for adding new Point with images for selected categories 157 TextFormImage tf22. 133 long globalTimeStamp = 0. 122 boolean followFriends = false. 149 Command addWP. 131 132 boolean syncFollow = false. 123 124 List oneFriend. 160 Command BACK_CMD. 142 Command setLine. 134 boolean synchronizationDone = false."Please Select Point!". 121 Command deleteFriends.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 115 int frndThr = 0. 161 Alert a = new Alert("Warning".INFO). 140 Command delete. 129 Vector whiteList. 162 lxxv . 125 Command stopFollowOne.AlertType. 150 151 CommaHyphenString chs = new CommaHyphenString(). 119 SimpleTextForm friendForm. 126 Command deleteFriend.lon) 155 TextForm previous. 137 Command setAsCurrent. 135 136 List WPselected. 127 128 Thread4Friend tff.null. 138 Command setDest1. 117 Hashtable thrHash = new Hashtable(). 120 Command stopFollow. // form for editing of selected Point 154 TextForm tf33. 159 Command CONT_CMD. 116 int currentlyShowed = 0. 144 145 146 List WPnotSel. 158 Command SAVE_CMD. 141 Command measDist. 143 Command resetLine. 147 Command setCurrent. 156 TextFormImage tf11. 152 TextForm tf1. // form for adding new Point on selected spot 153 TextForm tf2. 139 Command edit. 130 String friend. 118 Vector listOfFriends = new Vector(). // form for adding waypoint with user entered data for (lat. 148 Command setDest2.

Command createNewRoute. Command allRoutes. //vwpF. PVector newRouteVector. /** * @see MIDlet#startApp() */ protected void startApp() throws MIDletStateChangeException { mb = mbf. String nameR = "". Command showIDcom. //form for adding Point with complete info about List sorted.addElement(wp3). List routeNew. vwpF. List routeOptions.addElement(wp4). Command routeFin.addElement(wp1). vwpF. Command sortNameWP.Zarko Acimovic 163 164 165 166 167 168 169 170 171 172 coordinates 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 List WPList. //List of Points Command addNewWP. SimpleTextForm tf3. String[] pathToImage. Command delAllRoutes. List routeMain. boolean showID = false. List previousList. Command hideRoutes.getMapBackground(). Command addPoint. List delRouteList. Command sortWP. vwpF. mob = new MapObjects(mb). lxxvi . Command showRoutes. TextForm tfAdd. List routeList. ///form for defining name of route String[] categories.addElement(wp2). boolean routeSetting = false. Command delRoute.

1). 249 modes.setCommandListener(this). 230 231 oul = new Outlook(mb. 228 229 selP = new SelectorPoint(mb.1).1).addElement(wp5).". 232 233 ic = new ImageCanvas3(oul).addElement(wp9).Command.setFreeWaypointsV(vwpF).Command.List. 251 modes.Command. 247 compassCmd = new Command("Compass".1). 240 MAP_CMD = new Command("View on Map".Command.addElement(wp15). 253 modes. 242 243 mod = new Command("Mode".1).addElement(wp7). 252 modes. 250 modes. 254 modes.BUTTONS\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 237 238 DUMMY = new Command(" ".selP).append("PLEASE SELECT NEW MODE FROM MENU.addCommand(compassCmd). 219 vwpF. 220 vwpF.Command.Command.SCREEN.Command.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 213 vwpF. 216 vwpF. 245 selectCmd = new Command("Selection". 218 vwpF. 222 vwpF. 258 259 260 261 // Map View options lxxvii .mob).SCREEN. 234 235 236 //////////////////////////COMMANDS.addElement(wp6). 255 modes.addElement(wp8).addElement(wp10). 241 BACK_CMD = new Command("Back to Previous Screen".Command.addCommand(DUMMY).addElement(wp14).1).SCREEN. 221 vwpF.SCREEN. 223 vwpF.1).1).BACK. 217 vwpF. 239 DELIM = new Command("------------------".IMPLICIT).BACK.1). 256 257 opt = new Command("Option". 244 modes = new List("".SCREEN.addElement(wp11).addElement(wp13).1). 215 vwpF.SCREEN.mob..Command. 214 vwpF.MENUS. 246 mapviewCmd = new Command("Mapview".addElement(wp12). 248 exitCmd = new Command("Exit".null)..addCommand(mapviewCmd).addCommand(exitCmd).addCommand(selectCmd).Command.SCREEN. 224 225 226 227 mob.SCREEN.

SCREEN. 273 MVList. 305 WPselected.1).addCommand(MAP_CMD).SCREEN. 296 measDist = new Command("Measure Distance". 306 WPselected.addCommand(routes).1).setCommandListener(this).SCREEN.SCREEN.SCREEN.SCREEN.addCommand(friends).Command.1).Command. 277 MVList. 300 WPselected.addCommand(gps).SCREEN. 268 ZoomIn = new Command("Zoom In".1).Command. 279 MVList. 285 gpsTf. 276 MVList.1). 295 delete = new Command("Delete". 271 272 MVList. 264 routes = new Command("Routes".Command.1).1).SCREEN.addCommand(ZoomIn).Zarko Acimovic 262 MVList = new List("". 270 //Exit = new Command("Exit".IMPLICIT).addCommand(DUMMY). 284 gpsTf.Command. 269 ZoomOut = new Command("Zoom Out".1).Command. 265 gps = new Command("GPS".Command.addCommand(ZoomOut).addCommand(edit).SCREEN. 307 WPselected. 283 gpsTf = new SimpleTextForm(false).Command.addCommand(Points).setCommandListener(this).Command. 293 setDest1 = new Command("Set as Destination".setCommandListener(this).Command.addCommand(BACK_CMD). 297 298 299 WPselected.addCommand(measDist). 280 MVList.SCREEN.1).addCommand(CONT_CMD). 301 WPselected. 275 MVList. 278 MVList. 292 setAsCurrent = new Command("Set as Current". 286 287 288 289 290 // If Point is selected 291 WPselected = new List("".addCommand(setDest1).SCREEN.addCommand(BACK_CMD).addCommand(setAsCurrent). 308 309 lxxviii .Command. 263 Points = new Command("Waypoints".EXIT. 303 WPselected. 294 edit = new Command("Edit". 274 MVList.1).1). 302 WPselected.Command.Command. 304 WPselected.addCommand(delete).List.IMPLICIT). 266 267 friends = new Command("Friends".1). 281 282 CONT_CMD = new Command("Continue".1).SCREEN.addCommand(DUMMY).List.

343 ic. 344 345 346 tf1 = new TextForm(chs.addCommand(addWP).addCommand(DUMMY).addCommand(mod).getAppProperty("Categories")). 327 addNewWP = new Command("Add Waypoint".1).1).///form for adding new Point on selected spot 347 tf2 = new TextForm(chs.Command. 322 //WPnotSel. 320 WPnotSel.Command. 331 332 tfAdd = new TextForm(chs. 342 ic.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 310 311 // If Point is not selected 312 WPnotSel = new List("".SCREEN.1).List.getAppProperty("Categories"))./// form for editing of selected Point 348 tf33 = new TextForm(chs.IMPLICIT).getAppProperty("Categories")). lxxix .SCREEN.Command.List. 314 setDest2 = new Command("Set Destination".SCREEN. 330 showIDcom = new Command("Show/Hide ID".getCategories(this. 333 334 tfAdd.true). 336 337 sorted = new List("".1). 339 340 341 ic.1). 315 addWP = new Command("Add Waypoint".Command.List. 329 sortNameWP = new Command("Sort Waypoints by Name".false).Command.1).1).SCREEN.SCREEN.getCategories(this.Command.setCommandListener(this).Command.getCategories(this. 325 326 WPList = new List("".Command.1).SCREEN.addCommand(BACK_CMD).addCommand(setCurrent). 313 setCurrent = new Command("Set Current".getCategories(this.setCommandListener(this).addCommand(opt). 318 WPnotSel. 335 tfAdd.false).setCommandListener(this).IMPLICIT)./// form for editing of selected Point 349 350 SAVE_CMD = new Command("Save". 321 WPnotSel.IMPLICIT). 319 WPnotSel. 324 WPnotSel. 316 317 WPnotSel. 323 WPnotSel.setCommandListener(this).addCommand(measDist).SCREEN.addCommand(MAP_CMD).addCommand(CONT_CMD).addCommand(setDest2). 338 sorted.SCREEN.getAppProperty("Categories")). 328 sortWP = new Command("Sort Waypoints by Distance".false).

addCommand(MAP_CMD).setCommandListener(this).addCommand(CONT_CMD). selP.setCurrent(ic).setCommandListener(this). tf33. } public void commandAction(Command c.resetSelect(). lxxx . whiteList = new Vector(). tf33.addCommand(BACK_CMD).repaint(). ic.setCurrent(cc). d. } if (s==modes && c==mapviewCmd){ selP. selP. cc = new CompassCanvas(mob).Zarko Acimovic 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 tf1. selP.addCommand(CONT_CMD). } if (s==modes && c==selectCmd){ oul.resetBig().resetColor(). if (s==ic && c==mod){ d.setCurrent(modes).resetSelect(). d. tf1.setSelect(). Displayable s){ if (c==MAP_CMD) d.addCommand(BACK_CMD).setCommandListener(this). tf2.setCurrent(ic).addCommand(CONT_CMD). oul. } if (s==modes && c==compassCmd){ oul.setCommandListener(this). }catch(Exception e){} notifyDestroyed().resetColor(). } if (s==modes && c==exitCmd){ try{ destroyApp(false). d. d. cc.resetBig(). tf1. tf33. tf2. return.setCurrent(ic). tf2. cc.addCommand(BACK_CMD).setCurrent(ic).

ic = new ImageCanvas3(oul).setCurrent(ic).getLon()). d. mob.getSelectedWP(). } // ADD Point ON SELECTED SPOT if(s==WPnotSel && c==addWP){ tf1.setCurrent(ic).setLon(selP. ic.getName()=="selector") if(selectedWP. if(selectedWP. d.setCurrent(MVList). wp.setCurrent(WPnotSel).setDestinationPosition(wp). ic.setName("current"). wp.setName("dest"). mob. tf1.getSelector().addCommand(mod).setCurrentPosition(wp).getName()!="selector") { d.setCurrent(tf1).getSelector(). } if (s==ic && c==opt && routeSetting==false){ if(oul.setCommandListener(this).getSelector().addCommand(opt).setName("default").setLat(selP. d. d. 444 445 446 447 448 449 } if(s==cc && c==MAP_CMD){ cc.getSelect()==false) d.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 d.setCurrent(WPselected). ic. } } if(oul.setEnd().equals(tf1) && c == CONT_CMD){ lxxxi . previousList=null. } // IF Point NOT SELECTED if(s==WPnotSel && c==setCurrent){ Point wp = selP. } if(s==WPnotSel && c==setDest2){ Point wp = selP. 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 Point on selected spot 443 category"). //form for adding new //tf1. } if (s.setCurrent(ic).setType("Type will be set according to tf1.getLat()).getSelector().getSelect()==true) { selectedWP = selP.

getStringsOnly(catMatches). 485 //tf11.getCategoriesHyphen(this. 458 459 // elements of a selected category: as simle strings and as hyphen-strings 460 String catMatches = this.setCommandListener(this). //getting rid off blanco spots 477 pathToImage[i] = str. i<arCatMatches.setNameCHGR("Please select type").length]. i++){ 468 imageStr[i] = this. 451 int sel = tf1.arCatMatches. 484 tf11.setCurrent(tf11).length. 490 } lxxxii . 467 for(int i=0.length]. 463 464 // images that correspond to category elements 465 String[] imageStr = new String[arCatMatches.addCommand(BACK_CMD). 469 imageStr[i] = this. 473 for (int i=0.setName(name).img).setType("Please select type").getWithLowLine(catMatches).createImage(str). 486 tf11. 461 String[] arCatMatches = chs. i++){ 474 try{ 475 String str = categoryHyphen[sel] +"/"+imageStr[i].getAppProperty(categoryHyphen[sel]). 470 } 471 472 pathToImage = new String[arCatMatches.getAppProperty("Categories")). 483 tf11. 487 tf11. 466 Image[] img = new Image[arCatMatches. 462 String[] arCatHyphMatches = chs. i<arCatMatches.Zarko Acimovic 450 String name = tf1.length].compact(imageStr[i]). 452 453 // chs is instance of CommaHypenString class 454 // which helps us process hyphens and commas in 455 //. 478 img[i] = Image.getAppProperty(""+arCatHyphMatches[i]+"").length. 489 d.addCommand(SAVE_CMD).getSelected(). 488 tf11.getCategories(this.getName(). 476 str = compact(str). 479 } catch(Exception e){} 480 } 481 482 tf11 = new TextFormImage("".getAppProperty("Categories")).properties file 456 String[] category = chs. 457 String[] categoryHyphen = chs.

setImage(cmpct). } if(s==tf11 && c==SAVE_CMD){ Point wp = selP.setCurrent(tf1).getSelected().equals(tf2)){ name = tf2. wp. tf2. previous = tf2.setLon(selectedWP. d. tf2. sel = tf2. int sel = tf11.setLat(selectedWP. } //Edit of Point if(s==WPselected && c==edit){ tf2.setCurrent(ic).getSelected(). d.setType(selectedWP.setDestinationPosition(selectedWP). d.setCurrent(tf2).getSelector(). } if(s==WPselected && c==setAsCurrent){ mob.equals(tf2)||s.setCurrent(ic). if(s.setCurrent(WPnotSel).getName()). d. } if(s. } if(s==tf11 && c==BACK_CMD){ d.getLon()). } //Editing of waypoint OR inserting waypoint from text form if ( (s.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 if(s==tf1 && c==BACK_CMD){ d.equals(tf33)){ lxxxiii .getType()).getLat()).equals(tf33)) && c == CONT_CMD){ String name ="".getName()).setName(selectedWP. int sel = 0. } if(s==WPselected && c==setDest1){ mob.setCurrent(ic). String cmpct = compact(pathToImage[sel]).setName(tf11. wp.getName(). mob.addFreeWaypoint(wp).setCurrentPosition(selectedWP). tf2.

543 sel = tf33.setName(name).getSelected().addCommand(SAVE_CMD). 552 String[] categoryHyphen = chs. i<arCatMatches. 579 tf22.compact(imageStr[i]). i<arCatMatches.getCategories(this. 544 previous = tf33. i++){ 563 imageStr[i] = this.createImage(str).length].setCommandListener(this).getName(). 574 } catch(Exception e){} 575 } 576 577 tf22 = new TextFormImage("".img).length. 582 tf22. 565 } 566 567 pathToImage = new String[arCatMatches.getAppProperty("Categories")).getCategoriesHyphen(this. 568 for (int i=0.getStringsOnly(catMatches). 581 tf22.Zarko Acimovic 542 name = tf33. 561 Image[] img = new Image[arCatMatches.length]. 557 String[] arCatHyphMatches = chs. 558 559 // images that correspond to category elements 560 String[] imageStr = new String[arCatMatches. 556 String[] arCatMatches = chs. 562 for(int i=0. 571 str = compact(str). 564 imageStr[i] = this. 578 tf22. 545 } 546 547 548 // chs is instance of CommaHypenString class 549 // which helps us process hyphens and commas in 550 //.getWithLowLine(catMatches).length. //getting rid off blanco spots 572 pathToImage[i] = str. 580 tf22.setNameCHGR("Please select type").addCommand(BACK_CMD).getAppProperty(""+arCatHyphMatches[i]+"").arCatMatches. 573 img[i] = Image.getAppProperty(categoryHyphen[sel]). lxxxiv .properties file 551 String[] category = chs.length]. i++){ 569 try{ 570 String str = categoryHyphen[sel] +"/"+imageStr[i]. 553 554 // elements of a selected category: as simle strings and as hyphen-strings 555 String catMatches = this.getAppProperty("Categories")).

"blanco". 623 mob. 605 wp.setCurrent(tf22).getSelectedWP(). 620 wp. 592 } 593 594 if(s==tf22 && c==SAVE_CMD){ 595 596 //Editing of waypoint 597 if(previous == tf2){ 598 Point wp = selP. lxxxv . 617 wp.setLon(tf33.getLon()).setLon(tf2.getLat()).getSelected().setCurrent(ic)."blanco".setCurrent(WPselected).getLon(). 619 String cmpct = compact(pathToImage[sel]). 610 selP.setImage(cmpct). 588 } 589 590 if(s==tf22 && c==BACK_CMD){ 591 d. 606 wp. 608 selP.false).tf22.addFreeWaypoint(wp).getLon()). 624 d.setColor(). 599 if(wp. 621 wp."". 607 wp. 612 } 613 614 // New waypoint from text form 615 if(previous==tf33){ 616 Point wp = new Point(tf33.getName()).getLat().getLat()).false). 611 d. 625 } 626 } 627 628 629 // Delete Point 630 if(s==WPselected && c==delete){ 631 int k = selP.getSelected().setName(tf22.setName(tf22.tf22.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 583 d. 584 } 585 586 if(s==tf2 && c==BACK_CMD){ 587 d.getLat()==0){ 600 wp = new Point(tf2.getName().tf33. 601 } 602 wp.setLat(tf2. 618 int sel = tf22.setCurrent(ic).setCurrent(previous).setImage(cmpct).getLat().tf2. 603 int sel = tf22.deleteWP()."". 609 mob.getName()). 622 wp.getLon(). 604 String cmpct = compact(pathToImage[sel]).setLat(tf33.getName().deleteWP().addFreeWaypoint(wp).

657 selectedWP = selP.setString("Distance is "+k+" m").resetBig(). 639 } 640 } 641 642 if(s==WPselected && c==BACK_CMD){ 643 if(previousList==null) d.setTimeout(3000).getCurrentPosition().currentSet()==false){ 671 a. 645 } 646 647 648 // Measuring distance between current position and selected WAYPOINT 649 if(s==WPselected && c==measDist){ 650 if(mob. 635 d. 636 } else { 637 selP.setString("Current position is not set").setTimeout(3000).setTimeout(3000).setCurrent(ic). 678 d.setString("Current position is not set").measureDistance(selectedWP). 672 a.setString("Distance is "+k+" m"). 634 a.getName(). 669 long k = mob. 659 a. 670 if(mob.equals("dummy")){ 651 a.setTimeout(3000). 638 d.getSelector().setCurrent(ic).setCurrent(previousList). 653 d. lxxxvi .Zarko Acimovic 632 if(k==-1){ 633 a. 674 675 } else { 676 a. 644 if(previousList!=null) d. 658 long k = mob.setCurrent(a).getSelectedWP(). 652 a.setTimeout(3000).setString("More than one Point selected"). 677 a. 673 d.setCurrent(a).setCurrent(a).setCurrent(a). 661 } 662 663 } 664 665 666 // Measuring distance between current position and selected LOCATION 667 if(s==WPnotSel && c==measDist){ 668 selectedWP = selP. 654 655 } else { 656 a.setCurrent(a).measureDistance(selectedWP). 660 d.

695 if(showID==true){ 696 name = wp.getID().SCREEN.elementAt(i). 701 WPList.addCommand(cc). 697 } else { 698 name = wp.} 724 lxxxvii . 704 } 705 706 if(s==MVList && c==BACK_CMD){ 707 d.freeWaypoints. 683 684 685 686 687 688 // -----------------Showing up all Points and some operations--------------689 if(s==MVList && c==Points){ 690 setWPList(). 694 String name = "". 699 } 700 Command cc = new Command(name.setCurrent(WPList).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 679 } 680 } 681 682 if(s==WPnotSel && c==BACK_CMD) d. 702 } 703 d. } else {showID=true. 708 } 709 710 if(s==MVList && c==ZoomIn){ 711 oul.setCurrent(ic). 717 d.setCurrent(ic). 718 } 719 720 721 // displaying of IDs of icons 722 if(s==WPList && c==showIDcom){ 723 if(showID==true) {showID=false.setCurrent(ic).size().freeWaypoints.1).setCurrent(ic). 713 } 714 715 if(s==MVList && c==ZoomOut){ 716 oul.ZoomIn().getName(). 691 692 for(int i=0.ZoomOut().getName() +"_"+wp. 712 d. i++){ 693 Point wp = (Point)mob. i<mob.Command.

setType("").1). 730 if(showID==true){ 731 name = wp.20.getID().freeWaypoints.sortAscending(mob. 734 } 735 Command cc = new Command(name. 726 727 for(int i=0.getName() +"_"+wp.freeWaypoints. i++){ 728 Point wp = (Point)mob.setCurrent(WPList).elementAt(i).elementAt(i). i++){ 768 Point wp = (Point)sor. 769 String name = "". 765 766 Vector sor = mob.setName("Center of Map"). 767 for(int i=0.Zarko Acimovic 725 setWPList().setLon("20.42949821 750 tf33. 732 } else { 733 name = wp. lxxxviii . 737 } 738 d.80345511. 751 tf33.80345511"). 753 d. i<mob. 729 String name = "".setCurrent(tf33).//44.freeWaypoints.42949821"). i<sor.addCommand(cc).size().setCurrent(WPList).SCREEN.getCurrentPosition()).Command. 760 } 761 762 //sorting waypoints by distance 763 if(s==WPList && c==sortWP){ 764 setWPList().getName(). 736 WPList.setLat("44. 739 } 740 741 742 // Adding new Point with all attributes such as 743 // LATITUDE and LONGITUDE 744 // We deal with tf33 same as with tf2 (tf2 is used for 745 // inserting new data for selected location 746 // Here default values for coordinates are those of center of the map 747 748 if(s==WPList && c==addNewWP){ 749 tf33.size(). 754 } 755 756 757 758 if(s==tf33 && c==BACK_CMD){ 759 d. 752 tf33.

setCurrent(WPList).1). 807 oul.1).setWPselection().Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 770 if(showID==true){ 771 name = wp.SCREEN. 809 previousList = WPList. 788 } 789 d.Command. 808 d.length. 772 } else { 773 name = wp. 779 } 780 781 //sorting waypoints by name 782 if(s==WPList && c==sortNameWP){ 783 setWPList().getID().addCommand(cc).addCommand(cc).sortByName(). 799 } 800 801 //Displaying selected waypoint 802 if(s==WPList && c!=sortWP && c!=addNewWP && c!=MAP_CMD && c!=sortNameWP && c!=DUMMY && c!=BACK_CMD){ 803 String name = c.freeWaypoints. 785 for(int i=0. i<sor.getName()+" "+wp.ROUTES -------------------------------815 816 // Main Menu for Routes 817 if(s==MVList && c==routes){ lxxxix . 787 WPList.setCurrent(MVList). 774 } 775 Command cc = new Command(name.param=true.SCREEN. 784 String[] sor = mob. 790 } 791 792 793 if(s==WPList && c==MAP_CMD){ 794 d. 777 } 778 d.setCurrent(ic). 795 } 796 797 if(s==WPList && c==BACK_CMD){ 798 d.getName(). 810 } 811 812 813 814 // -------------. i++){ 786 Command cc = new Command(sor[i].selectWP(name).setCurrent(WPList). 776 WPList. 806 oul. 804 mb. 805 selP.getLabel().setSelect().Command.setCurrent(WPselected).

822 routeMain.Command.addCommand(createNewRoute).getName().addCommand(routeFin). 842 tf3. 854 addPoint = new Command("Add Waypoint". 819 createNewRoute = new Command("New Route".IMPLICIT).Command. 856 routeNew. 849 newRouteVector. 827 String name = route.Command. 828 Command cr = new Command(name.getRoutes().addRoute(newRouteVector).setCurrent(routeMain). 825 for(int i=0. 858 routeNew. 859 860 d.Command. 836 } 837 838 //Creating a New Route 839 if(s==routeMain && c==createNewRoute){ 840 tf3 = new SimpleTextForm(false).addCommand(DUMMY).List. 855 routeFin = new Command("Route Finished". 851 mob.setCurrent(MVList). i++){ 826 PVector route = (PVector)mob. 857 routeNew. 832 } 833 834 if(s==routeMain && c==BACK_CMD){ 835 d.size(). 852 853 routeNew = new List("".SCREEN.setCommandListener(this). 850 newRouteVector.addCommand(cr).getName()).setCommandListener(this).addCommand(BACK_CMD). 861 } 862 863 xc .addCommand(addPoint). 820 routeMain.setCurrent(tf3).setName(tf3.elementAt(i).1).SCREEN.IMPLICIT). 821 routeMain.SCREEN.setCommandListener(this).List. 824 routeMain. 843 d.1).1). 823 routeMain.addCommand(SAVE_CMD).Zarko Acimovic 818 routeMain = new List("".setVisible().setCurrent(routeNew). i<mob.getRoutes(). 841 tf3.SCREEN.1). 830 } 831 d.true). 829 routeMain.addCommand(DELIM). 844 } 845 846 847 if(s==tf3 && c==SAVE_CMD){ 848 newRouteVector = new PVector("".

892 String name = wp.selectWP(name). i<allR.SCREEN. 898 } 899 } 900 if(rt.addCommand(showRoutes).elementAt(i). 888 d.setVisible(). 889 }else{ 890 rt.getLabel(). 904 d. 884 if(rt.resetVisible().Command.setCurrent(ic). 875 routeOptions. 895 selP.addCommand(BACK_CMD).size()!=0){ 886 if(rt. 867 routeOptions = new List("". 902 a.addCommand(MAP_CMD).setTimeout(5000).setTitle("Warning"). 869 delRoute = new Command("Delete Route". 872 routeOptions.size()==0){ 901 a.setCurrent(routeOptions). 894 oul.Command.resetColor(). 870 routeOptions.elementAt(0).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 864 // Selection of specific route 865 if(s==routeMain && c!=createNewRoute && c!=DUMMY && c! =BACK_CMD && c!=DELIM){ 866 nameR = c. 896 selP.getName()==nameR) { 885 if(rt. 893 selP. 873 routeOptions.getVisible()==true){ 887 rt.getName().IMPLICIT).addCommand(DUMMY).addCommand(delRoute).1).resetBig().SCREEN.setSelect().getRoutes().setCurrent(a). 877 } 878 879 //Viewing selected route 880 if(s==routeOptions && c==showRoutes){ 881 Vector allR = (Vector) mob.setCurrent(ic).setCommandListener(this). 882 for(int i=0. 905 } 906 907 } xci . i++){ 883 PVector rt = (PVector)allR.List. 874 routeOptions.size(). 871 routeOptions. 876 d.setString("Route has no points to show"). 868 showRoutes = new Command("Show/Hide Route".1). 897 d. 891 Point wp = (Point) rt. 903 a.

getName()).getSelector().size().resetVisible().setName(newRouteVector.setWPselection().elementAt(0).removeRoute(nameR). oul.getID()). } //Adding new point in current route if(s==routeNew && c==addPoint){ if(oul.setCurrent(ic). } //Mapview if(s==routeOptions && c==MAP_CMD){ Vector v = mob. } } //Deletion of selected route if(s==routeOptions && c==delRoute){ Vector v = mob. i++){ PVector wpv = (PVector)v. Point wp = selP.getRoutes().getSelect()==true){ mob.setTypeID(newRouteVector.elementAt(i). } } d. for(int i=0.elementAt(i).getName()==nameR){ Point p = (Point) wpv.Zarko Acimovic 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 if(rt.getName()).getName()!=nameR) rt. wp. i<v.getName()==nameR){ mob. if(wpv.setCurrent(routeMain). } //Back on routeMain if(s==routeOptions && c==BACK_CMD){ d. if(wpv. } } d.setSelect(). i=1000. for(int i=0.getRoutes(). selP. wp.setCurrent(ic). oul. i<v. i=1000. i++){ PVector wpv = (PVector)v.size(). xcii .removeRoute(newRouteVector).selectWP(p.

1).addCommand(onGPSc).setCurrent(routeNew).setImage("route"). 994 offGPSc = new Command("Off".SCREEN.Command.setCurrent(ic). 998 d.txt"). 996 gpsList. usually it's GPS.addRoute(newRouteVector). 1005 //Specifying GPS coordinates resource 1006 gpsTf. 969 d.List. 962 d. 999 } 1000 1001 if(s==gpsList && c==onGPSc){ 1002 if(gpsON==false){ 1003 gpsON=true.Command. 960 newRouteVector.setLabel("Please select source of GPS coordinates. xciii .setCurrent(gpsList).setRoute().txt"). 961 mob.resetSelect().setCurrent(ic).IMPLICIT).SCREEN.setName("GPS. 963 } 964 965 if(oul. 967 oul. 981 d. 970 } 971 972 } 973 974 if(s==ic && routeSetting==true && c==opt){ 975 d. 968 routeSetting = true.getSelect()==false){ 966 oul. 995 gpsList.addElement(wp). 997 gpsList.addCommand(offGPSc).1). 982 } 983 984 985 986 987 988 989 //--------------------------------GPS ON/OFF-----------------------------990 991 if(s==MVList && c==gps){ 992 gpsList = new List("". 980 routeSetting = false. 976 } 977 978 if(s==routeNew && c==routeFin){ 979 oul. 1004 followFriends = false.setCommandListener(this). 1007 gpsTf.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 959 wp.setCurrent(ic).setSelect(). 993 onGPSc = new Command("On".

size()>0){ 1050 for (int i=0. 1046 friendList.addCommand(stopFollow).setCurrent(ic).List.size(). 1040 addNewFriend = new Command("Add New Friend". 1043 friendList.addCommand(BACK_CMD). Command. 1033 1034 } 1035 1036 // --------------------------. 1018 } 1019 1020 1021 1022 if(s==gpsTf && c==CONT_CMD){ 1023 resource = gpsTf.addCommand(DELIM). 1012 } 1013 } 1014 1015 if(s==gpsList && c==offGPSc){ 1016 gpsON=false.hashCode(). 1031 t1.Command. 1026 synchronizationDone=false.addCommand(deleteFriends).getName().setType("GPS.hashCode(). 1029 currentlyShowed = t1. xciv . 1042 deleteFriends = new Command("Delete Friends".setCurrent(ic).addCommand(DUMMY). 1024 1025 syncFollow = true. Command.SCREEN. 1048 friendList. i<listOfFriends. 1047 friendList.setCurrent(ic).SCREEN.SCREEN. 1017 d.start(). //GPS textform 1010 } else { 1011 d. 1027 1028 t1=new Thread(this).IMPLICIT).SCREEN.elementAt(i).setCurrent(gpsTf).HANDLING FRIENDS' ISSUES ------------------1037 1038 if(s==MVList && c==friends){ 1039 friendList = new List("". 1030 gpsHash = t1. 1049 if(listOfFriends. 1052 Command cc = new Command(f.txt"). 1009 d.getName(). 1045 friendList. 1032 d.Zarko Acimovic 1008 gpsTf. i++){ 1051 Friend f = (Friend)listOfFriends.1).addCommand(addNewFriend). 1041 stopFollow = new Command("Stop Follow Friends".1).1). Command. 1044 friendList.1).

1094 friendList = new List("". 1086 mob. 1075 Integer hID = new Integer(tff. Command.1).1). 1088 d.addElement(hID).setLabel2("Source of coordinates").SCREEN. 1096 stopFollow = new Command("Stop Follow Friends". 1062 friendForm.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 1053 friendList.setCurrent(friendList).mob. 1093 listOfFriends. 1058 } 1059 1060 if(s==friendList && c==addNewFriend){ 1061 friendForm = new SimpleTextForm(false).setCurrent(ic). 1087 ic. 1097 deleteFriends = new Command("Delete Friends".setName("Mika"). 1082 } 1083 1084 if(s==friendList && c==stopFollow){ 1085 whiteList.addCommand(cc).deleteAllFriends(). 1065 friendForm.setLabel("Friend").addElement(f).tff).removeAllElements().addCommand(DUMMY).setCurrent(friendForm).setCommandListener(this).List. 1063 friendForm.removeAllElements(). 1057 d.ic. 1068 friendForm. Command. Command.1).SCREEN. 1089 } 1090 1091 if(s==friendList && c==deleteFriends){ 1092 mob.setCurrent(ic). 1076 whiteList.getID().tff. 1095 addNewFriend = new Command("Add New Friend".getName(). 1098 friendList.IMPLICIT).getID()).mb.deleteAllFriends(). 1071 } 1072 1073 if(s==friendForm && c==CONT_CMD){ 1074 tff = new Thread4Friend(whiteList. 1054 } 1055 } 1056 friendList.addCommand(CONT_CMD).getType().setType("Mika. 1064 friendForm. 1069 1070 d.friendForm.SCREEN.friendForm.start(). 1077 1078 tff.setCommandListener(this). 1080 listOfFriends. 1081 d. 1066 1067 friendForm.getName().oul).repaint(). 1079 Friend f = new Friend(friendForm.txt"). xcv .

1119 friend = compact(friend).setCurrent(oneFriend). 1121 stopFollowOne = new Command("Stop Follow". 1124 oneFriend.SCREEN. 1129 1130 d.addCommand(deleteFriends). 1131 } 1132 1133 if(s==friendList && c==BACK_CMD){ 1134 d.getName().equals(friend)) { 1141 1142 if(f. 1120 oneFriend = new List("".getLabel().addCommand(MAP_CMD). 1114 d.setCommandListener(this). Command.setCurrent(friendList).addCommand(BACK_CMD).addCommand(DELIM). i++){ 1139 Friend f = (Friend)listOfFriends.1).IMPLICIT).addCommand(DUMMY). 1103 friendList.getName(). 1100 friendList.size().setCommandListener(this).addCommand(cc).SCREEN.addCommand(BACK_CMD). 1105 if(listOfFriends.addCommand(stopFollow). 1101 friendList.1).SCREEN. 1108 Command cc = new Command(f.elementAt(i).setCurrent(friendList).elementAt(i). 1123 oneFriend. 1104 friendList.Command. 1115 } 1116 1117 if(s==friendList && c!=addNewFriend && c!=stopFollow && c! =deleteFriends && c!=MAP_CMD && c!=BACK_CMD && c!=DELIM){ 1118 friend = c. i++){ 1107 Friend f = (Friend)listOfFriends. 1140 if(f. Command. 1110 } 1111 } 1112 friendList.Zarko Acimovic 1099 friendList.List.setCurrent(MVList).addCommand(stopFollowOne). 1102 //friendList.1).getThread()==false){ xcvi . 1126 oneFriend. i<listOfFriends. 1125 oneFriend.addCommand(MAP_CMD). 1128 oneFriend. 1113 d.addCommand(deleteFriend).size().size()>0){ 1106 for (int i=0. 1127 oneFriend. 1135 } 1136 1137 if(s==oneFriend && c==MAP_CMD){ 1138 for(int i=0. i<listOfFriends. 1122 deleteFriend = new Command("Delete". 1109 friendList.addCommand(addNewFriend).

i<listOfFriends. 1181 } 1182 } 1183 d.start(). 1148 tff.getName().getID()).deleteFriend(f. 1165 if(f. 1169 } 1170 } 1171 d. 1147 f.removeElementAt(i).setFirst(). 1184 } 1185 1186 } 1187 xcvii .setCurrent(ic). 1156 } 1157 1158 if(s==oneFriend && c==BACK_CMD){ 1159 d. 1172 } 1173 1174 if(s==oneFriend && c==deleteFriend){ 1175 for(int i=0.removeElement(new Integer(f. i++){ 1176 Friend f = (Friend)listOfFriends. 1146 f.setThread(null).getHash()).setID(tff.setCurrent(friendList).getName().Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 1143 tff = new Thread4Friend(whiteList.getName().addElement(hID). 1179 mob.setThread(tff).deleteFriend(f. 1145 whiteList.getHash())).size().getHash())).elementAt(i).equals(friend)) { 1178 whiteList.size(). 1167 mob.removeElement(new Integer(f. 1177 if(f. 1144 Integer hID = new Integer(tff.elementAt(i).getHash()).f.oul). 1180 listOfFriends. 1160 } 1161 1162 if(s==oneFriend && c==stopFollowOne){ 1163 for(int i=0.ic.setCurrent(ic).equals(friend)) { 1166 whiteList. 1152 } 1153 } 1154 } 1155 d. 1149 tff.setFirst(). i++){ 1164 Friend f = (Friend)listOfFriends.setCurrent(ic).mb. 1168 f. 1150 } else { 1151 f.getID()).mob. i<listOfFriends.

temp. 1193 int nextIndex = 6.comma+1). 1217 c1 = temp.indexOf('. 1199 1200 int begin = -2. 1204 String c2 = "". 1215 temp = compact(temp). 1201 int end = index.getTimeStamp()). 1222 begin = index-1. 1224 index = nextIndex. 1220 timeStamp = temp.length()).substring(comma+1.lastIndexOf('\n').end).index+1).indexOf('. 1219 c2 = temp.substring(0. 1223 end = nextIndex. 1218 int nextComma = temp.'.parseLong(timeStamp).indexOf('\n').comma). 1225 nextIndex = s.hashCode()==currentlyShowed){ 1211 /** 1212 if(synchronizationDone==false && syncFollow==true){ 1213 do{ //Synchronization 1214 String temp = s.Zarko Acimovic 1188 1189 //----------------------This part of code deals with GPS--------------------1190 public void run(){ 1191 while(followFriends==true || gpsON==true){ 1192 String s = this.'). 1216 int comma = temp. 1226 } while(currentTS<this. 1194 int index = s. 1197 1198 int lastIndex = s.indexOf('\n'. 1195 1196 nextIndex = s.indexOf('\n'.substring(nextComma+1. 1210 if(t. 1221 currentTS = Long. xcviii .substring(begin+2.currentThread(). 1206 long currentTS = 0.nextIndex+1). 1207 1208 while(index<lastIndex && gpsON==true){ 1209 Thread t = Thread. 1202 1203 String c1 = "".nextComma).getResourceAsString(resource). 1205 String timeStamp = "".

length()). }catch(Exception e){} if(wp!=null){ mob.substring(comma+1. if(temp. 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 mob.setDrawablePoints().parseLong(timeStamp). 1245 temp. 1248 temp.'. } else { temp = compact(temp). 1247 temp.true).c1.equals("")){ wp = new } if(syncFollow==true) { } String temp = temp = compact(temp).equals("")){ //na kraju ce index = lastIndex+1. 1250 1251 1252 1253 1254 s. if(gpsON==true){ .setCurrentPosition(wp).substring(begin+2.nextIndex+1).temp. 1246 temp.comma+1). xcix synchronizationDone = true. int comma = c1 = int nextComma = c2 = timeStamp = currentTS = begin = index-1."".comma).nextComma). }*/ Point wp = null.indexOf('.indexOf('\n'. end = nextIndex. index = nextIndex. 1249 Long. 1236 1237 1238 s.substring(0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 1227 1228 1229 1230 1231 1232 Point(c2.indexOf('.setTimeStamp(currentTS).end).substring(nextComma+1."blanco".'). 1239 1240 temp da bude prazno 1241 1242 1243 1244 temp. 1233 1234 1235 this. if(!c1.sleep(1000).resource. nextIndex = } try{ Thread.

getY()>160 || 1266 mob. 1300 for(int i=0.Zarko Acimovic 1265 if((mob. 1292 * Integer representations of blanko characters are 9 and 32 1293 * Also. characters with integer representation between 0 and 33 1294 * can not be printed out in WSDD console.getCurrentPosition().setBackground(wp).length(). 1306 } 1307 1308 public String compactFine(String s){ 1309 int k = s. 1268 ic.toCharArray(). i++){ 1301 int temp = (int)d[i].repaint().getCurrentPosition(). 1269 1270 } 1271 } 1272 } 1273 } 1274 } 1275 1276 } 1277 1278 /** 1279 * @see MIDlet#pauseApp() 1280 */ 1281 protected void pauseApp() { 1282 } 1283 1284 /** 1285 * @see MIDlet#destroyApp(boolean) 1286 */ 1287 protected void destroyApp(boolean flag) throws MIDletStateChangeException { 1288 } 1289 1290 1291 /** Blanco characters are possible to occur in names of pictures.length().getX()>170 || mob. 1303 } 1304 int kk = ret. 1298 char[] d = s.getCurrentPosition().getY()<10) && oul. 1302 if(temp>32) ret+=d[i].length. so I excluded them too 1295 */ 1296 public String compact(String s){ 1297 int k = s. 1299 String ret = "".getSelect()==false ) 1267 mb. c . 1305 return ret.length().getX()<10 || mob.getCurrentPosition(). i<d.

char m =' '. } int kk = ret. try{ m = (char)is.setString("There is no such resource"). } public void setWPList(){ ci . if(temp!=32 && temp!=9) ret+=d[i]. }catch(Exception e){} } try{ is. }catch(Exception e){} s=compactFine(s).read(). i++){ int temp = (int)d[i]. } public void setTimeStamp(long tms){ globalTimeStamp = tms. } public String getResourceAsString(String resource){ InputStream is = null. try{ m = (char)is.close(). for(int i=0. } public long getTimeStamp(){ return globalTimeStamp. }catch(Exception e){} while(m!=65535){ s+=m.read().getResourceAsStream(resource).length.length(). i<d. } //conversion of resource into string String s = "". d.getClass(). String ret = "". try{ is = this. return ret.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 char[] d = s. return s.toCharArray(). }catch(Exception e) { a.setCurrent(a).

List.addCommand(addNewWP).addCommand(BACK_CMD). WPList.addCommand(showIDcom).addCommand(sortNameWP). WPList. } } cii . WPList. WPList. WPList.addCommand(DELIM).setCommandListener(this). WPList.addCommand(sortWP).IMPLICIT).Zarko Acimovic 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 WPList = new List("". WPList.addCommand(DUMMY). WPList.

875 5 0.048 0.29 1 0.0490881667 0.074 0.207 0.068318936 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) ciii LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.75 0 0.67 2 0.068318936 0.03 0.107 0.0981763335 0.36 0.33 0 0.4 54 1 78 0.864 1 1.18 33 0.436 0 0.2049568079 0.4696284108 0 0.917 19 0.145 0.037 0.381 90 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .4 0.929 0 0.1366378719 0.86 0 1 5 0.1174071027 0.5 0 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.1366378719 0.1857260387 0.0490881667 0.29 27 0.068318936 0.29 0 0 0.0490881667 0.25 0.556 0 0 31 0.9 1 1 0.2049568079 0.923 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.16 1 0.4696 0 0.0490881667 0.9909 1.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.3 0.5 1 0.889 1 0.2540449746 0.068318936 0 0.875 1 0 0 0 1 0.67 152 0.143 0.077 0 0.1429 0.667 152 0.1366378719 0.991 1 1 0 0 0 0 0.334 25 0.

java 1 2 3 4 5 6 7 8 9 10 11 /** * MathFP implements fix point as a replacement for floating point */ // Processed by NMI's Java Code Viewer 4.se/compendium/node94. Number Of Local Methods Description Number of local Methods measures the number of methods locally declared in a class. It is the size of the interface of a class and allows conclusions on its complexity.arisa.8.com // Copy registered to Evaluation Copy public class MathFP { civ .htmlplanet.1 © 1997-2000 B.html MathFP. Lemaire // Website: http://njcv.Zarko Acimovic Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions MathFP suffers from Lack of Documentation and Number of Local Methods.htmlplanet.com E-mail: info@njcv. Inherited methods are not considered. http://www.

MathFP. 0): "+MathFP.round(frac. frac))).toString(MathFP. 0): "+MathFP.019")) 49 return asinBad(l).6 . 25 //System.0.div(num. frac).X is closer to real sin(X) than calculated value for small X 33 * @author BMa 34 */ 35 public static long sin(long l) { 36 if (abs(l) > toFP("0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 12 13 /** Modulo (% operator) implementaition missing in MathFP 2. by).out.div(num. by): "+MathFP. 31 32 /** Fix of bad sin() in MathFP 2.mul(by.mul(by. 27 } 28 29 30 //private static long sinLimit=toFP("0.mul(by.toFP(MathFP.6 14 * @author BMa 15 */ 16 public static long mod(long num. does not work properly??? 21 //System. 18 long frac = MathFP.println("MathFP.div(num.toString(by)).mul(by. frac))).toString(MathFP.println("MathFP.div(num.toLong(frac)).println("MathFP.mod: "+MathFP.div(num.println("mod: "+MathFP.toString(MathFP.div(num.println("MathFP.out.0055").round(MathFP. 52 } 53 54 cv . 20 //long frac = MathFP. 40 } 41 42 //private static long asinLimit=toFP("0.toString(num)+" by: "+MathFP. 0))). 43 44 /** Fix of bad asin() in MathFP 2.0055")) 37 return sinBad(l).out.6 .0. by).out. 22 frac = MathFP. long by) { 17 //System.toString(num MathFP.toString(frac)).better(MathFP. by).out. by). 50 else 51 return l. frac): "+MathFP. 38 else 39 return l.round(MathFP. 23 //System.019"). 24 //System.0. by))). 26 return num . 19 //System. 0).out.X is closer to real asin(X) than calculated value for small X 45 * @author BMa 46 */ 47 public static long asin(long l) { 48 if (abs(l) > toFP("0.println("MathFP.

private static int _digits = 8.1L. } return _digits. private static long _dmul = 0x5f5e100L. private static long _one. public static int setPrecision(int i) { if(i > 24 || i < 0) return _digits. l != 0L. for(long l = _one. 0) >> _fbits. private static long _pi. _digits = 0. _digits++. public static final long MIN_VALUE = 0x8000000000000001L.Zarko Acimovic 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 private static int _fbits = 24.) { l /= 10L. private static long _flt = 0L. } cvi . _one = 1L << i. _fbits = i. } public static long toLong(long l) { if(l < 0L) return -(round(-l. _dmul = 1L. public static long E. E = e[1] >> (int)_flt. public static long PI. _dmul *= 10L. _flt = 24 . else i -= 2048. else return round(l. private static long _fmask = 0xffffffL. } public static long toLongZare(long i) { if(i >= 0) i += 2048.i. PI = _pi >> (int)_flt. } public static int getPrecision() { return _fbits. _fmask = _one . public static final long MAX_VALUE = 0x7fffffffffffffffL. 0) >> _fbits). private static long e[]. return i >> 12.

parseLong(s. 154 return (flag ? "-" : "") + Long.substring(i. 133 } 134 long l = 0L.substring(j + 1._fbits >> 1)) >> i . s. 123 if(s.length() < _digits. int i) { 112 long l1 = l >= 0L ? 1L : -1L. 142 } 143 144 public static String toString(long l) { 145 boolean flag = false.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 106 107 public static long toFP(long l) { 108 return l << _fbits." + s.indexOf(46).i. 126 int j = s. s = "0" + s)._fbits. 127 if(j >= 0) { 128 for(s1 = s. 116 else 117 l <<= _fbits . _digits). 139 if(i == 1) 140 l2 = -l2. s. 153 for(s = Long.parseLong(s1) + 1L. 137 long l1 = Long.length(). 113 if(abs(i) < 25L) 114 if(_fbits < i) 115 l = l + l1 * (1L << (i . 135 if(i != j) 136 l = Long. 118 return l. 148 l = -l.toString(l1) + ".length()). 146 if(l < 0L) { 147 flag = true. s1 = s1 + "0").toString(l2).charAt(0) == '-') 124 i = 1. 152 String s. 155 } cvii . 149 } 150 long l1 = l >> _fbits. 141 return l2.substring(0. 109 } 110 111 public static long convert(long l. 138 long l2 = (l << _fbits) + (l1 << _fbits) / _dmul.length() < _digits.length() > _digits) 130 s1 = s1. s1. 131 } else { 132 j = s. 119 } 120 121 public static long toFP(String s) { 122 int i = 0. 129 if(s1. 151 long l2 = _dmul * (l & _fmask) >> _fbits. 125 String s1 = "-1". j)).

_digits) + i). return l + l1. } public static long round(long l.end). j < i. int i) { long l1 = 10L. i)).indexOf('. } public static long getWholePart(String s){ int end = s.substring(0. } public static long min(long l. }*/ public static long max(long l. int end = s. long wh = toFP(s).substring(0. long wh = toFP(s). String s = toString(round(l. l1 = div(toFP(5L).indexOf('.'). if((l1 & l2) == 0L) return l * (l1 >> i). } /** public static long getWholePart(long l){ String s = toString(l). toFP(l1)). j++) l1 *= 10L. s = s.Zarko Acimovic 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 public static String toString(long l. if(l < 0L) l1 = -l1. long l2 = _fmask.substring(0. } public static long mul(long l.end). long l1) { boolean flag = false. (s. return wh. return wh. s = s. long l1) { return l >= l1 ? l : l1. if((l & l2) == 0L) return (l >> i) * l1. int i = _fbits. long l1) { return l1 >= l ? l : l1. int i) { if(i > _digits) i = _digits. for(int j = 0.length() .'). cviii . return s.

} cix . max(l. return flag ? -l2 : l2. if(l < 0L) l = -l. int i = _fbits. long l1) { boolean flag = false. } long l2 = (l << i) / l1 << _fbits . max(l. for(. else return flag ? -l3 : l3.i. } public static long sub(long l. l1 >>= 1. if(l1 == _one) return l. } public static long div(long l. i--) { l >>= 1. } public static long add(long l. l2 >>= 1. i--) { l >>= 1.l1. long l1) { return l + l1. l1) >= 1L << 63 .i. for(. if(l1 < 0L) l1 = -l1. l4 += (l & ~l2) * (l1 & l2) >> i. l1 >>= 1. l3 = l3 + l4 + ((l & l2) * (l1 & ~l2) >> i) << _fbits .Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 if(l < 0L && l1 > 0L || l > 0L && l1 < 0L) flag = true.i. if(l < 0L && l1 > 0L || l > 0L && l1 < 0L) flag = true.i. } long l3 = (l >> i) * (l1 >> i) << i. long l4 = (l & l2) * (l1 & l2) >> i. long l1) { return l . if(l3 < 0L) throw new ArithmeticException("Overflow"). if(l1 < 0L) l1 = -l1. l1) >= 1L << 63 . if((l1 & _fmask) == 0L) return l / (l1 >> i). if(l < 0L) l = -l.

297 long l3 = l2 / 90L. l4) + (long)(0x1921f9c >> (int)_flt). 271 long l1 = l + _one >> 1. int i) { 267 if(l < 0L) 268 throw new ArithmeticException("Bad Input"). 291 long l2 = l1. 262 else 263 return l. 279 } 280 281 public static long sqrt(long l) { 282 return sqrt(l. l4) . 283 } 284 285 //public static long sin(long l) { 286 private static long sinBad(long l) { 287 long l1 = mul(l. l3). 269 if(l == 0L) 270 return 0L. cx .l1). l4) + (0x14594dL >> (int)_flt).Zarko Acimovic 258 259 public static long abs(long l) { 260 if(l < 0L) 261 return -l. 288 l1 %= toFP(360L). l1) >> 1. j++) 273 l1 = l1 + div(l. 298 long l4 = mul(l3. 289 if(l1 < 0L) 290 l1 = toFP(360L) + l1. 301 } 302 303 //public static long asin(long l) { 304 private static long asinBad(long l) { 305 if(abs(l) > _one) { 306 throw new ArithmeticException("Bad Input").(0xa55b13L >> (int)_flt). 24). 274 275 if(l1 < 0L) 276 throw new ArithmeticException("Overflow"). 292 if(l1 >= toFP(90L) && l1 < toFP(270L)) 293 l2 = toFP(180L) .l1. 299 long l5 = mul(mul(mul(mul(0xfffffffffffee21aL >> (int)_flt. j < i. 294 else 295 if(l1 >= toFP(270L) && l1 < toFP(360L)) 296 l2 = -(toFP(360L) . PI)). l3). div(toFP(180L). 272 for(int j = 0. 300 return l5. 264 } 265 266 public static long sqrt(long l. 277 else 278 return l1.

k < 16. 351 long l3 = 0L. j++) 344 l1 = mul(l1. 340 l = abs(l). l) . 348 l &= _fmask. cxi . 313 } 314 } 315 316 public static long cos(long l) { 317 return sin(PI / 2L . e[4] >> (int)_flt). sqrt(_one + mul(l. l)))). 334 } 335 336 public static long exp(long l) { 337 if(l == 0L) 338 return _one. 352 long l4 = 1L. l) + (long)(0x1921f27 >> (int)_flt). j < i / 4. 330 } 331 332 public static long atan(long l) { 333 return asin(div(l. 310 long l1 = mul(mul(mul(mul(0x236cf >> (int)_flt. e[i % 4] >> (int)_flt). 311 long l2 = PI / 2L . 355 l2 = mul(l2. 349 if(l > 0L) { 350 long l2 = _one. 353 for(int k = 0. k++) { 354 l3 += l2 / l4. 322 } 323 324 public static long tan(long l) { 325 return div(sin(l). 309 l = abs(l).mul(sqrt(_one . 312 return flag ? -l2 : l2. 326 } 327 328 public static long cot(long l) { 329 return div(cos(l). 345 346 if(i % 4 > 0) 347 l1 = mul(l1. 343 for(int j = 0.l). 318 } 319 320 public static long acos(long l) { 321 return PI / 2L .(long)(0x92748 >> (int)_flt). 339 boolean flag = l < 0L. l1). sin(l)).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 307 } else { 308 boolean flag = l < 0L. 341 int i = (int)(l >> _fbits). cos(l)). l) . l).l). 342 long l1 = _one. l) + (long)(0x15acb4 >> (int)_flt).asin(l).(long)(0x36d0dd >> (int)_flt).

l). l5 += ((j % 2 != 0 ? 1L : -1L) * l3) / (long)j.> 0. long l2 = _one. l -= _one. return l1. long l2 = 0L. long l1 = 0L.) l2 = mul(l2. j++) { long l3. if(l4 > l2 || l2 <= 0L || l4 <= 0L) break. l1 = l3. } return l4 + l5. for(int j = 1. l1). l)). j < 20. for(i = 0. i++) l >>= 1. long l4 = (long)i * (long)(0xb17218 >> (int)_flt). } public static long log(long l) { if(l <= 0L) throw new ArithmeticException("Bad Input").Zarko Acimovic 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 l4 *= k + 1. int i. l >= _one << 1. if(l1 == 0L) l3 = l. else l3 = mul(l1. long l5 = 0L. } public static long pow(long l. } l1 = mul(l1. if(l < _one) return -log(div(_one. i-. if(l != 0L) cxii . if(l2 < 0L) throw new ArithmeticException("Overflow"). l). for(int i = (int)l1 >> _fbits. l3). long l1) { boolean flag = l1 < 0L. } if(flag) l1 = div(_one. if(l3 == 0L) break. l1 = abs(l1).

0x1415e5bfL. PI = _pi. E = e[1]. 0x3699205cL }). } } cxiii . l1))). _pi = 0x3243f6aL. } else { if(l1 == 0L && l == 0L) throw new ArithmeticException("Bad Input"). if(l1 > 0L) l2 = atan(div(l. long l1) { long l2 = 0L. } static { _one = 0x1000000L. e = (new long[] { _one. } return l2. else return l2. exp(mul(log(l). l1)). 0x763992eL. 0x2b7e151L.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 l2 = mul(l2. } public static long atan2(long l.atan(abs(div(l. else l2 = 0L. else if(l1 < 0L) { l2 = (l1 >= 0L ? PI : -PI) . if(flag) return div(_one. l1 & _fmask))). l2). l2 = (l >= 0L ? PI : -PI) / 2L.

074 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) cxiv LD 0.2049568079 0.29 1 0.25 0.33 0 0.381 90 0.36 0.068318936 0.29 27 0.077 0 0.436 0 0.923 0.1366378719 0.3 0.889 1 0.18 33 0.917 19 0.2049568079 0.0981763335 0.1366378719 0.4 54 1 78 0.5 1 0.29 0 0 0.068318936 0.929 0 0.67 2 0.875 5 0.145 0.037 0.75 0 0.4696284108 0 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.068318936 0.4696 0 0.1366378719 0.107 0.143 0.068318936 0 0.86 0 1 5 0.67 152 0.864 1 1.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .875 1 0 0 0 1 0.207 0.0490881667 0.334 25 0.1857260387 0.03 0.1174071027 0.048 0.667 152 0.556 0 0 31 0.9909 1.9 1 1 0.1429 0.0490881667 0.16 1 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.4 0.2540449746 0.991 1 1 0 0 0 0 0.0490881667 0.5 0 0.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.0490881667 0.

se/compendium/node121. How many comments are lacking in a class. Structure and content of the comments are ignored. MapObjects and SelectorPoint * */ //import java.io. public class Outlook { MapBackground mb.*. http://www. cxv . import javax.java 1 2 3 4 5 6 7 8 9 10 11 12 13 /** * * Outlook coordinates work MapBackground. //import java.html Outlook.microedition.lcdui. MapBackgroundFactory mbf.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions The problem with class Outlook is Lack of Documentation Lack Of Documentation Description.*.util.*.arisa. considering one class comment and a comment per method as optimum. MapObjects mob.

52 } else { 53 if(select==true) selP."blanco". 44 mb. 27 } 28 29 public void drawOutlook(Graphics g){ 30 if(startup==false) { 31 mb.route). 45 first=false. 21 22 Outlook(MapBackground mb.getCurrentPosition().drawMapBackground(g). 18 boolean first = false.setBackground(center). 26 this. 32 startup = true. 20 boolean WPselection = false. 55 }*/ 56 57 if(select==true) selP.drawMOB(g. 46 } 47 48 /** 49 if(route==false){ 50 mob. 58 mob. 39 first=false.drawMOB(g.selectWP(mob.drawMapBackground(g). 60 61 } 62 cxvi . 36 37 if(first==true && mob. 15 boolean select = false.currentSet()==true && WPselection==false){ 43 selP.83168".drawSelP(g).Zarko Acimovic 14 SelectorPoint selP.selP = sp."".drawSelP(g).false). SelectorPoint sp) { 23 24 this. 33 } 34 35 mb."20. 59 if(select==true) selP. 16 boolean route = false.getName()).drawCaption(g)."". 40 } 41 42 if(first==true && mob.drawSelP(g). 17 boolean startup = false.mb = mb. 51 if(select==true) selP.drawMOB(g.currentSet()==false && WPselection==false){ 38 selP.route).mob = mob. MapObjects mob.getNewEdge().false). 54 mob.445". 19 Point center = new Point("44.selP = new Point(mb.route). 25 this.

setMap(side).Zoom(). } public void resetRoute(){ route = false.cH). } public void ZoomOut(){ boolean zoom = mb.Zoom().setCanvasWH(cW. } public void setSelect(){ select = true.setSelectorScreen(side).int cH){ mb.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 public void ZoomIn(){ boolean zoom = mb.ZoomIn(). } public boolean getSelect(){ return select. } /** Sets map due to Pan transformation */ public void setMap(char side){ if(select == false) mb. WPselection = false. } public void setCanvasWH(int cW.ZoomOut(). if(select == true) selP. } public void setRoute(){ route = true. } public void resetSelect(){ select = false. first = true. } } cxvii . //selP. } public void setWPselection(){ WPselection = true. if(zoom==true) selP. if(zoom==true) selP.resetBig().

86 0 1 5 0.Zarko Acimovic Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .1857260387 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) cxviii LD 0.077 0 0.037 0.0490881667 0.0981763335 0.991 1 1 0 0 0 0 0.556 0 0 31 0.929 0 0.923 0.0490881667 0.145 0.03 0.36 0.207 0.4 54 1 78 0.29 1 0.67 2 0.048 0.107 0.29 0 0 0.2049568079 0.16 1 0.5 0 0.75 0 0.25 0.9909 1.2540449746 0.667 152 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.3 0.889 1 0.9 1 1 0.0490881667 0.074 0.864 1 1.1366378719 0.67 152 0.2049568079 0.4696 0 0.1366378719 0.068318936 0.4696284108 0 0.381 90 0.29 27 0.068318936 0 0.5 1 0.4 0.0490881667 0.18 33 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.068318936 0.917 19 0.068318936 0.143 0.436 0 0.1174071027 0.1429 0.33 0 0.875 5 0.875 1 0 0 0 1 0.334 25 0.1366378719 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions Improvement of LCOM Description cxix .

and the number of method pairs having common instance variables.Zarko Acimovic The Improvement of LCOM (cf. Classes having a low cohesion indicate errors in the design. public class Point { /** type of Waypoint * -2 .current Point * 0 .arisa.se/compendium/node94. //import java.arisa. The less separate components there are the higher is the cohesion of the methods in the class.*. /** Point ID * */ private int ID = 0.3) metric is a measure for the number of connected components in a class.html Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class.html Lack of Cohesion in Methods Description The Lack of Cohesion in Methods metric is a measure for the number of not connected method pairs in a class representing independent parts having no cohesion.arisa. cxx .html Point.*. http://www. http://www.free Point * n .util. A component are methods of a class sharing (being connected by) instance variables of the class. It is the size of the interface of a class and allows conclusions on its complexity. http://www.se/compendium/node116. That is the relative number of directly connected public methods in the class.destination Point * -1 .arisa.se/compendium/node117. import javax.se/compendium/node118.lcdui.microedition.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 /** * Class Point represents geographical object */ //import java. It represents the difference between the number of method pairs not having instance variables in common.*.html Number Of local Methods Description Number of local Methods measures the number of methods locally declared in a class.2. Lack of Cohesion in Methods 3.io.route Point */ private int typeID = 0. Inherited methods are not considered. http://www.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 /** Counter */ private static int cnt = 0. South or North */ //private char sideNS. /** Float-point representation of latitude */ private long lat. /** Side of the world. /** Seconds of longitude in Integer */ private long secLon. /** Degrees of latitude in Integer */ private long degLat. /** Side of the world. /** Seconds of latitude in Integer */ private long secLat. /** Degrees of longitude in Integer */ private long degLon. /** Minutes of latitude in Integer */ private long minLat. /** Total number of latitude seconds */ cxxi . West or East */ //private char sideWE. /** Float-point representation of longitude */ private long lon. /** Minutes of longitude in Integer */ private long minLon.

//char side2. long slat. //char side1. /** Regular constructor * @author Zarko Acimovic */ Point(long dlat. /** Help variable */ long dm1=0.Zarko Acimovic 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 long totLatSec. long mlat. /** Name of the Point */ String name = "default". /** String that describes image */ String imgString = "blanco". /** Total number of longitude seconds */ long totLonSec. long dlon. /** x coordinate of Point on Canvas */ private long x = 5. String t. /** Help variable */ long dm2=0. String n. /** y coordinate of Point on Canvas */ private long y = 5. /** Type of the Point */ String type = "default". long slon. /** Distance between this point and point which asks sorting */ private long distance. /** Help variable */ long rr=1000. long mlon.boolean setNewID){ cxxii .

MathFP. 131 minLat=MathFP. 165 //char s2.div(secLat. 132 secLat=MathFP. 134 135 136 degLon=MathFP.add(minLat. 164 long totLonSec.MathFP. 168 lon = MathFP.toFP(dlon).sideNS = s1.name = ss1.type = ss2. 148 149 totLatSec = MathFP.lat. 154 cnt++.toFP("3600")).toFP(mlon).sixty)).toFP("3600")). 143 144 long sixty=MathFP.MathFP.add(degLat.getWholePart(latS). 163 //char s1. 166 String ss1. 145 146 lat = MathFP. MathFP. 142 type=t.toFP(dlat).div(secLon.mul(lon. 151 152 if(setNewID==true){ 153 ID = cnt.sub(this. 172 //this. String ss2.toString(lat).out. 178 long temp = MathFP. 139 //sideWE=side2.div(totLatSec.toFP(slat).div(totLonSec. 175 String lonS = MathFP.sideWE = s2.toFP("3600")). 147 lon = MathFP.toFP("3600")).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 130 degLat=MathFP.toFP(slon).MathFP. 169 this. //default type 157 //System.add(minLon. 140 141 name=n.sixty)). 171 //this.this.mul(lat.toFP(mlat).sixty)). 155 } 156 typeID = 0.div(MathFP.degLat).add(degLon. 170 this.degLat = MathFP.println("cnt="+cnt). MathFP.div(MathFP. 158 } 159 160 161 162 Point(long totLatSec. 176 177 this. boolean setNewID){ 167 lat = MathFP. cxxiii .toFP("60"). 133 //sideNS=side1. 138 secLon=MathFP.MathFP. 150 totLonSec = MathFP. 173 174 String latS = MathFP.MathFP.toString(lon). 137 minLon=MathFP.sixty)).

name=wp.mul(temp.secLat.toFP("60")).println("cnt="+cnt).totLonSec = wp.minLon.lat.out.Zarko Acimovic 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 temp = MathFP. if(setNewID==true){ ID = cnt.toFP("60")).degLat).minLat = MathFP.degLon = MathFP.totLonSec. this.sub(temp.toString(temp)). temp = MathFP. temp = MathFP. degLon=wp. temp = MathFP. this. //default type //System.lon = wp.toFP("60")).totLatSec.secLon = MathFP.mul(temp. temp = MathFP.MathFP. this.mul(temp.totLatSec = totLatSec.secLat = MathFP.toFP("60")). } typeID = 0. type=wp. minLat=wp. temp = MathFP.this. secLat=wp.sub(this.getWholePart(lonS). temp = MathFP.mul(temp. this. //sideNS=wp.this.mul(temp. } Point(Point wp.minLon = MathFP.totLatSec = wp.MathFP.sub(temp. this.degLon. boolean setNewID) { degLat=wp.toString(temp)).sideNS.sub(this.secLon.MathFP.MathFP. temp = MathFP.minLat.lon.type.degLon). this. this.lat.getWholePart(MathFP.this. this. //sideWE=wp.lon.minLat).MathFP. secLon=wp. this.sideWE.getWholePart(MathFP.totLonSec = totLonSec. this.toFP("60")).name.degLat.mul(temp.minLon). cxxiv . temp = MathFP.lon.degLon).MathFP. cnt++.toFP("60")).lat = wp. minLon=wp. this.sub(this.

degLon).totLonSec = MathFP.degLon).sub(temp.lon.MathFP.degLat).mul(this.totLatSec = MathFP.lat.mul(temp. this.name = name.MathFP. long temp = MathFP.mul(temp. this.mul(temp.minLon). temp = MathFP.degLon = MathFP.sub(temp.lat = MathFP.this.toFP("60")).out. String lon.sub(this.type = type.toString(temp)).MathFP.toFP("60")). //this. this.MathFP. cnt++.println("cnt="+cnt).toFP(lat). //char sideNS.secLon = MathFP. temp = MathFP.getWholePart(lon). String type.sub(this.sub(this.toFP("3600")). imgString = wp.minLon = MathFP.toString(temp)). this.this.this.MathFP.this. temp = MathFP. this. temp = MathFP.toFP("60")).toFP(lon). this.getWholePart(MathFP. boolean setNewID){ //this. temp = MathFP. } Point (String lat.toFP("60")).lat.lon = MathFP.getImage().getWholePart(lat).mul(temp. this.toFP("3600")).minLat = MathFP.mul(this. this.minLat).MathFP.getWholePart(MathFP. this. String name. cnt++. this.toFP("60")). String img. } typeID = 0.lon. this.degLat).sideWE = sideWE.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 if (setNewID==true){ ID = cnt.MathFP.secLat = MathFP. if (setNewID==true) { ID = cnt. temp = MathFP.sideNS = sideNS.MathFP. } cxxv .degLat = MathFP.mul(temp. //char sideWE.lat. temp = MathFP.mul(temp.lon. //default type //System.sub(this. temp = MathFP. this. temp = MathFP.toFP("60")).

String lon.sub(temp.lon. String image. 293 this. 315 316 this.toFP("3600")).this.sub(this. 300 301 temp = MathFP.lat.mul(temp.lat.mul(temp.degLat). 322 cnt++. 295 296 this.sub(temp.MathFP.lat.mul(temp.MathFP.toFP("60")).mul(this.Zarko Acimovic 281 typeID = 0. 323 } 324 typeID = 0. 298 temp = MathFP.MathFP.name = name.type = type.toString(temp)).toFP("60")).MathFP. 317 this.lon = MathFP.getWholePart(MathFP.out.toFP("60")). 329 * 330 * @version advanced cxxvi .getWholePart(lat).lon. 284 285 } 286 287 288 289 /** 290 Point(String lat.totLonSec = MathFP.this.lat = MathFP.getWholePart(lon).degLat).toFP("60")).mul(temp.degLat = MathFP.getWholePart(MathFP. 304 this. 303 temp = MathFP. 299 this. 283 imgString = img.degLon = MathFP.minLon = MathFP.toString(temp)). 310 311 temp = MathFP. 312 temp = MathFP. //default type 282 //System. 292 this.toFP("60")).this. String name. 305 306 this.minLon).secLat = MathFP.mul(temp. 314 this.toFP("3600")). 318 319 320 if (setNewID==true) { 321 ID = cnt.this. String type.MathFP.toFP(lat).secLon = MathFP.minLat).MathFP.minLat = MathFP.totLatSec = MathFP.degLon).lon.MathFP. 313 temp = MathFP.toFP("60")).sub(this. 307 temp = MathFP.MathFP. boolean setNewID){ 291 this. 294 this.sub(this.degLon). 308 temp = MathFP.toFP(lon). 309 this. 302 temp = MathFP.mul(this. 297 long temp = MathFP.println("cnt="+cnt). //default type 325 326 }*/ 327 328 /** Calculates distance between two Points.mul(temp.sub(this.

} /** Sets type of Point * @return String */ public void setName(String name) { this.lon).name = name.type = type. } /** Returns name of Point * @return String */ public String getName() { return name. wp. } /** Sets type of Point * @return String */ public void setType(String type) { this. return MathFP. } /** Returns type of Point * @return String */ public String getType() { return type.lon). } /** Sets distance */ public void setDistance (long dist){ distance = dist. } /** Returns side of the world as String * @return String * */ //public char getNS(){ // return sideNS. } /** Gets distance * @return long */ public long getDistance (){ return distance.this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 * @return long */ public long measureDistance(Point wp){ Coordinates c1 = new Coordinates(this.lat. Coordinates c2 = new Coordinates(wp.lat.toLong(c1. //} /** Returns side of * @return String the world as String cxxvii .distance(c2)).

} cxxviii . } /** Returns seconds of latitiude * * @author Zarko Acimovic * @version initial */ public long getSLat(){ return secLat. //} /** Returns degrees of latitiude * * @author Zarko Acimovic * @version initial */ public long getDLat(){ return degLat. } /** Returns degrees of longitude * * @author Zarko Acimovic * @version initial */ public long getDLon(){ return degLon. } /** Returns minutes of longitude * * @author Zarko Acimovic * @version initial */ public long getMLon(){ return minLon.Zarko Acimovic 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 * */ //public char getWE(){ // return sideWE. } /** Returns minutes of latitiude * * @author Zarko Acimovic * @version initial */ public long getMLat(){ return minLat.

"+" x="+this."+MathFP.toString(this."+" y="+this.getY()+" "+this.minLon)+". 441 } 442 443 /** Returns latitude as floating point 444 * 445 * @author Zarko Acimovic 446 * @version initial 447 * @return Float-Point 448 */ 449 public long getLat(){ 450 return lat. 451 } 452 453 /** Returns longitude as floating point 454 * 455 * @author Zarko Acimovic 456 * @version initial 457 * @return Float-Point 458 */ 459 public long getLon(){ 460 return lon.minLat) +".toString(this.getName()+"\n" 471 +this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 433 /** Returns seconds of longitude 434 * 435 * @author Zarko Acimovic 436 * @version initial 437 * @return int 438 */ 439 public long getSLon(){ 440 return secLon.degLat)+".lon)+" "+MathFP.secLat)+". 461 } 462 463 /** Prints Point 464 * @author Zarko Acimovic 465 * @version initial 466 * @return String 467 */ 468 public String toString(){ 469 return "ID="+getID()+"\n"+"Longitude: "+MathFP.lat)+" "+MathFP.toString(this.secLon)+"."+MathFP.toString(this.toString(this.toString(this.getImage()."+MathFP.toString(this.toString(this.degLon) +". 472 } 473 474 /** Sets x and y coordinates on Canvas relative to wp 475 * Usually wp is newEdge 476 * @author Zarko Acimovic 477 * @version initial 478 */ cxxix ."+MathFP.getX()+ 470 "\nLatitude: "+MathFP.

482 ///System.sub(wp.this. 494 } 495 496 /** Checks if this Point is beetwen wp1 and wp2 497 * 498 * @version initial 499 * @return boolean 500 */ 501 public boolean check(Point wp1.mul(MathFP.toString(this.getLat()="+MathFP.toString(pixLon)).println("pixLat="+MathFP. Point wp2){ 502 503 long lim1Lat = wp1.println("wp. 510 long bigLon.getLon()="+MathFP.println("----this------------------"+this).toLong(x).toFP("3600")). long pixLon.div(MathFP.toLong(y).getLon()). 504 long lim1Lon = wp1.toString(wp.getLat()="+MathFP.sub(this.wp.out.getLon().pi xLat).out.println("-------newEdge---------------"+wp).getLon()="+MathFP.getLon())).println("pixLon="+MathFP. 505 long lim2Lat = wp2. 488 489 y = MathFP.out.MathFP. long pixLat){ 480 //System.getLat())). 507 508 long bigLat.toString(this. 490 y = MathFP.MathFP.getLon(). 509 long miniLat. 519 } 520 521 if (lim1Lon>lim2Lon){ cxxx .div(MathFP. 512 513 if (lim1Lat>lim2Lat){ 514 bigLat=lim1Lat. 484 ///System.getLon())).getLat(). 516 } else { 517 bigLat=lim2Lat. 491 492 x = MathFP.out.toString(pixLat)).println("wp. 518 miniLat=lim1Lat. 481 //System. 485 ///System.mul(MathFP.getLat().Zarko Acimovic 479 public void setXY (Point wp.out.getLat()).getLat(). 515 miniLat=lim2Lat.getLon().println("this. 506 long lim2Lon = wp2.toFP("3600")). 493 x = MathFP. 487 ///System.pi xLon).out. 483 //System.toString(wp.out.getLat())).out. 486 //System. 511 long miniLon.println("this.

int yy = Integer.getLon() && this.parseInt(l. } if (miniLat<this.getLat()<bigLat && miniLon<this.getLat() && this. } /** Returns y-position of Point on Canvas * * @author Zarko Acimovic * @version initial * @return long */ public long getY() {return y. } else { return false. } public int getYY() { Long l = new Long(y).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 bigLon=lim1Lon. int xx = Integer. miniLon=lim1Lon. } } /** Returns x-position of Point on Canvas * * @author Zarko Acimovic * @version initial * @return long */ public long getX() {return x.getLon()<bigLon){ return true. return yy. } public int getXX() { Long l = new Long(x).toString()). miniLon=lim2Lon. } else { bigLon=lim2Lon. } /** Adds inc on x */ public void addX(long inc ){ this. } cxxxi . return xx.toString()).parseInt(l.x+=inc.

y=y.Zarko Acimovic 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 /** Substracts dec from x */ public void subX(long dec){ this. } cxxxii .x=x. } /** Returns total number of lon-seconds for Point * * @author Zarko Acimovic * @version initial * @return long */ public long getLonSec() { return totLonSec. } /** Sets x-position of Point on screen */ public void setX(long x){ this.x-=dec. } /** Sets y-position of Point on screen */ public void setY(long y){ this.y+=inc. } /** Adds inc on y */ public void addY(long inc){ this.y-=dec. } /** Returns total number of lat-seconds for Point * * @author Zarko Acimovic * @version initial * @return long */ public long getLatSec() { return totLatSec. } /** Substracts dec from y */ public void subY(long dec){ this.

long pixLat. 641 } 642 643 public int getID(){ 644 return ID.destination Point 638 */ 639 public int getTypeID(){ 640 return typeID.this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 624 625 /** Sets ID of Point 626 * 0 .this.getImage().getXX()-25.getName(). 658 } 659 660 public void drawPoint(Graphics g. 668 if (this.fillRect(this.this.simple Point 627 * 1 .fillRect(this.equals("blanco")){ 667 g.equals("current")) 669 g.getXX()-3.6.0). 670 671 if (this.getName().drawString(this.equals("dest")) cxxxiii .6). Point newEdge.getName().pixLon.setXY(newEdge.getXX()-3.getYY()-3.simple Point 636 * 1 . long zoomLv){ 661 662 this.6.getImage().getYY()-3. 663 if(this.current Point 637 * 2 . 652 } 653 654 /** Returns name of the image 655 */ 656 public String getImage(){ 657 return imgString.getYY() +5.this.pixLat). long pixLon. 645 } 646 647 648 /** String that represents image 649 */ 650 public void setImage(String s){ 651 imgString = s. 665 } 666 if(this.current Point 628 * 2 .destination Point 629 */ 630 public void setTypeID(int i){ 631 typeID = i.6).equals("route")){ 664 g. 632 } 633 634 /** Returns ID of Point 635 * 0 .

getXX()-18.getName().Zarko Acimovic 672 g.getName().getYY()-3.txt")) 675 g.this.getName(). 682 683 if (this.this.this.getXX()-18.this.this. 692 try{ 693 img = Image. 673 674 if (this. 706 } 707 708 } cxxxiv .getXX()-18.equals("blanco") && ! this.0).getName().this.getYY()+11.getYY() +11.getName().0).drawImage(img.drawString(this.txt")) 678 g.getYY() +11.getImage().0).getName(). 694 }catch(Exception e){} 695 g.drawString(this.equals("GPS")) 681 g.this.getImage()).this.0).getName().getYY() +11.this.getName(). 702 } 703 704 public void setLon(String s){ 705 lon = MathFP.0).equals("route")){ 691 Image img = null.toFP(s).drawString(this.0).getYY() +11.getImage().createImage(this.getName().drawString(this.this.equals("GPS.getXX()-18.getXX()-18.toFP(s).equals("Mika")) 684 g. 697 } 698 } 699 700 public void setLat(String s){ 701 lat = MathFP.this.0).getYY() +11.this. 685 686 if (this.this.getXX()-3.this.drawString(this.equals("Mika.getXX()-18.getName().getYY() +11. 676 677 if (this.getXX()15.equals("Str8")) 687 g.getName().0). 688 } 689 690 if(!this.this.getName().drawString(this. 696 //g.this. 679 680 if (this.drawString(this.

864 1 1.145 0.9909 1.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .75 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.29 27 0.1366378719 0.037 0.875 1 0 0 0 1 0.107 0.068318936 0.3 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.86 0 1 5 0.1174071027 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) cxxxv LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.67 2 0.889 1 0.0490881667 0.4 0.1366378719 0.2540449746 0.0490881667 0.143 0.0490881667 0.048 0.9 1 1 0.207 0.991 1 1 0 0 0 0 0.33 0 0.1366378719 0.5 1 0.03 0.2049568079 0.16 1 0.4696284108 0 0.381 90 0.5 0 0.1429 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.068318936 0.36 0.068318936 0.334 25 0.923 0.068318936 0 0.67 152 0.29 1 0.929 0 0.4 54 1 78 0.074 0.25 0.29 0 0 0.875 5 0.917 19 0.1857260387 0.556 0 0 31 0.0490881667 0.18 33 0.2049568079 0.436 0 0.4696 0 0.077 0 0.0981763335 0.667 152 0.

*.io.util. cxxxvi .Zarko Acimovic Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions PVector is OK.java 1 2 3 4 5 6 7 8 /** * * PVector enables drawing and sorting of points by name and distance */ import java. PVector. //import java.*.

} } /** Returns vector of Points sorted by distance * from Point wp in ascending order * * @version initial * @return Vector */ cxxxvii . } } PVector(Vector v. if (route==true) { this. ID = cnt.lcdui.simple Vector * 1 . cnt++. boolean route){ super(). i<v. cnt++.addElement(v.route */ private int ID = 0. i++){ this.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 import javax. } else { ID = 0. public class PVector extends Vector { /** ID of WP Vector * 0 . private static int cnt = 0. if (route==true) { ID = cnt. boolean visible = false.elementAt(i)). } else { ID = 0.microedition.boolean route){ super(). private String name ="". } for (int i=0.*.size(). PVector(String name.name = name.

i++){ 70 ht. 83 //Hashtable ht = new Hashtable().this. i<this.size()].this.elementAt(i).i<size.addElement(ht. 85 for(int i=0. 71 } 72 HeapSorter hp = new HeapSorter(). i<size.size(). 74 Vector sorted = new Vector().out. 84 String names[] = new String[this.heapsort(distances).size().measureDistance(wp).setDistance(distances[i]). 62 long[] distances = new long [size]. 77 } 78 79 public String[] sortByName(){ 80 //System.size(). 81 //int size = this.get(new Long(firstChars[i]))).elementAt(i)).getName().Zarko Acimovic 60 public Vector sortAscending(Point wp){ 61 int size = this.i<size. 90 } 91 HeapSorter hp = new HeapSorter(). 93 //Vector sorted = new Vector(). i++){ 86 Point whs = (Point) this.put(new Long(firstChars[i]). 87 //firstChars[i] = (long) whs. 75 for (int i=0.size(). 73 hp.charAt(0). //from warehouse 65 distances[i]=whs. 95 //System. 66 whs. 92 hp. 76 return sorted.get(new Long(distances[i]))). 69 for (int i=0. 88 //ht. 67 } 68 Hashtable ht = new Hashtable().put(new Long(distances[i]).getName(). 94 //for (int i=0. cxxxviii . 96 return names.addElement(ht. i++) { 64 Point whs = (Point)this.i++) sorted. i<size.println("wwwwww").elementAt(i). 82 //long[] firstChars = new long[size].elementAt(i)). 89 names[i]=whs. 63 for (int i=0.println("wwwwww\n"+sorted). 97 } 98 99 /** Returns vector of Points sorted by distance 100 * from WayPint wp in descending order 101 * 102 * @version initial 103 * @return Vector 104 */ 105 public Vector sortDescending(Point wp){ 106 int size = this.i++) sorted.out.heapsort(names).

i<size. String type){ 121 int size = this.elementAt(i). 153 } 154 cxxxix . i<size.sortAscending(wp).measureDistance(whs). 112 } 113 114 /** Return vector of specific Points of type 'type' 115 * sorted by distance in ascending order from Point wp 116 * 117 * @version initial 118 * @return Vector 119 */ 120 public Vector sortAscending (Point wp.elementAt(i)). //from warehouse 125 distances[i]=wp. i<size.put(new Long(distances[i]).addElement(wpnt).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 107 Vector temp1 = new Vector(). 150 str += wp. i++){ 129 ht.this.i++) { 135 Point wpnt = (Point)ht. 126 } 127 Hashtable ht = new Hashtable(). 123 for (int i=0. 132 hp.get(new Long(distances[i])).heapsort(distances).toString(). 110 for (int i=0. i++){ 149 Point wp =(Point)this. i<size. 108 Vector temp2 = new Vector(). 151 } 152 return str.i<size. 137 } 138 return sorted. 109 temp1 = this. 111 return temp2.elementAt(i). 134 for (int i=0. 122 long[] distances = new long [size]. 139 } 140 141 /** Prints array of Points 142 * @version initial 143 * @return String 144 */ 145 public String toString(){ 146 String str="". i++){ 124 Point whs = (Point)this.i++ ) temp2.equals(type)) sorted. 148 for (int i=0.size().size(). 133 Vector sorted = new Vector(). 136 if (wp. 147 int size = this.getType(). 130 } 131 HeapSorter hp = new HeapSorter().addElement(temp2. 128 for (int i=0.elementAt(size-i)).

getLon()<bigLon){ v. wp2. Point wp2){ Vector v = new Vector().addElement(wp).getLat() && wp.getLon(). if (miniLat<wp. return v. long long long long lim1Lat lim1Lon lim2Lat lim2Lon long long long long bigLat.println("Vektor je\n"+v). wp2. } else { bigLon=lim2Lon. miniLon=lim1Lon. } for (int i=0.getLon(). } } //System.getLat()<bigLat && miniLon<wp. wp1. } /** Merges two vectors * * @version initial */ cxl .Zarko Acimovic 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 /**Returns all Points in rectangle * defined by wp1 and wp2 as points * of diagonal * * @version initial * @return Vector */ public Vector getPoints(Point wp1. miniLon.getLat(). } if (lim1Lon>lim2Lon){ bigLon=lim1Lon.getLat(). if (lim1Lat>lim2Lat){ bigLat=lim1Lat.out. i<this. bigLon.getLon() && wp. miniLat.elementAt(i). miniLon=lim2Lon.i++){ Point wp = (Point)this. miniLat=lim1Lat. = = = = wp1. } else { bigLat=lim2Lat.size(). miniLat=lim2Lat.

removeElementAt(c). i<this.size().getLatSec())<5*pixLat1 && 227 Math.elementAt(i)). int pixLon){ 218 //System.route cxli . 234 } 235 else { 236 Integer k = (Integer)toDelete.elementAt(0).size()). 240 } 241 } 242 243 /** Edits Point 244 * 245 * @author Zarko Acimovic 246 * @version not yet implemented 247 */ 248 public void editWP(Point wp){ 249 } 250 251 252 /** Sets ID of WPVector 253 * 0 . 239 return c. i<v. 219 //System. 238 this. 220 Vector toDelete = new Vector().size()==0) { 233 return -1.println("Unutar DELETE"). 221 long pixLat1 = MathFP.addElement(v. 237 int c = k.toLong(pixLon).size()>1 || toDelete. 229 } 230 } 231 232 if(toDelete. i++){ 225 Point wp2 = (Point)this. 226 if ( Math.println(this.abs(wp2.elementAt(i).toLong(pixLat).out.out. i++ ){ 208 this.getLatSec()wp. 223 224 for (int i=0.getLonSec()wp. 209 } 210 } 211 212 /** Deletes Point 213 * 214 * @author Zarko Acimovic 215 * @version initial 216 */ 217 public int deleteWP1(Point wp. 222 long pixLon1 = MathFP.simple WPVector 254 * n .Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 206 public void mergeWith(Vector v){ 207 for (int i=0.size(). int pixLat.abs(wp2.addElement(new Integer(i)).getLonSec())<5*pixLon1 ){ 228 toDelete.intValue().

j<this. j++){ cxlii .newEdge.drawPoint(g. boolean route. 273 } 274 275 /** Returns name WPVector 276 */ 277 public void setName(String s){ 278 name = s. 301 } else { 302 for(int j=0. 291 } 292 293 public void drawVector(Graphics g.out.pixLat. 300 wp1. 283 } 284 285 public void resetVisible(){ 286 visible = false. 267 } 268 269 /** Returns name WPVector 270 */ 271 public String getName(){ 272 return name.println("routeVisible="+this.out.size()-1. long pixLat. Point newEdge.getVisible()). 295 /////System.simple WPVector 263 * 1 . 279 } 280 281 public void setVisible(){ 282 visible = true. long zoomL){ 294 /////System. 296 if(route==true){ 297 if(this.getVisible()==true){ 298 if(this. 259 } 260 261 /** Returns ID of WPVector 262 * 0 .zoomL).size()==1){ 299 Point wp1 = (Point) this.route 264 */ 265 public int getID(){ 266 return ID.Zarko Acimovic 255 * 256 */ 257 public void setID(int i){ 258 ID = i. long pixLon. 287 } 288 289 public boolean getVisible(){ 290 return visible.pixLon.elementAt(0).println("route="+route).

929 0 0.436 0 0. i++){ 315 Point wp = (Point) this.1429 0.0981763335 0.25 0. 309 g.zoomL).wp2.getXX().167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.889 1 0.pixLon.newEdge. 308 wp2.991 1 1 0 0 0 0 0.875 5 0.18 33 0.drawLine(wp1.4 0.zoomL).4 54 1 78 0.107 0.pixLat).drawPoint(g.elementAt(i). 306 //wp2. 305 //wp1. 307 wp1.143 0.923 0.1174071027 0.elementAt(j+1).864 1 1.5 0 0.zoomL).381 90 0.elementAt(j).068318936 0 0.getYY()). 316 wp.1366378719 0.size().1857260387 0.newEdge.068318936 0.67 152 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 303 Point wp1 = (Point) this.pixLat.4696284108 0 0.1366378719 0.pixLon.drawPoint(g.pixLon.wp1.0490881667 0. Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.29 1 0.0490881667 0.556 0 0 31 0.75 0 0.33 0 0.068318936 0. 304 Point wp2 = (Point) this.4696 0 0.86 0 1 5 0.145 0.037 0.pixLat).285 0 Complexity cxliii LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.2540449746 0.29 0 0 0.2049568079 0.3 0.875 1 0 0 0 1 0.getYY().2049568079 0.wp2.pixLon.pixLon.setXY(newEdge.03 0.36 0.0490881667 0.068318936 0.667 152 0.1366378719 0.getXX().334 25 0.16 1 0. i<this.setXY(newEdge.9 1 1 0.074 0.5 1 0.pixLat.67 2 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .048 0.0490881667 0.newEdge.pixLat.9909 1.207 0.29 27 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0. 310 } 311 } 312 } 313 } else { 314 for(int i=0.077 0 0.drawPoint(g.917 19 0. 317 } 318 } 319 320 } 321 322 323 }.

Zarko Acimovic Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) cxliv .

10 MapObjects mob.*.mob = mob. 17 18 SelectorPoint(MapBackground mb. SelectorPoint. 16 boolean big = false. 15 boolean colorSet=false. 7 8 public class SelectorPoint{ 9 MapBackground mb.util.microedition. up/down commands 26 */ 27 public void setSelectorScreen(char s){ 28 29 30 if(s=='r'){ cxlv . 6 import javax.java 1 /** 2 * SelectorPoint controls selection and identification of geographical object 3 */ 4 import java.selP = mob.mb = mb.lcdui. 13 int n = 200. 22 this. MapObjects mob){ 19 20 this. 12 int m = 255. 5 //import java.*.*. 11 Point selP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions SelectorPoint is OK. 23 } 24 25 /** Sets selector point on Screen due to user's left/right . 21 this.io. 14 int s = 0.getCurrentPosition().

50 if (selP. 58 } 59 } 60 if(s=='d'){ 61 if (selP.mb.setSelectorWorld(mb.setXY(mb.getNewEdge().min.mb.setSelectorWorld(mb. mb.getCanvasWidth()) selP.getNewEdge(). 53 //Paning 54 mb.sec) for Selector before panning 52 this.getY()<mb.getPixLat()).mb. 32 if (selP.Zarko Acimovic 31 if (selP. 56 //calculation of new Selector position on panned map 57 selP. 45 46 } 47 } 48 if(s=='l'){ 49 if (selP.getNewEdge().getPixLat()).getPixLon().setSelectorWorld(mb.getPixLon(). 40 //Paning 41 mb. 35 //da bi znao gde je on stvarno.getX()>0 && selP.getPixLon().getPixLat()). 42 mob. 62 if (selP.getPixLon(). 55 mob.sec) for Selector before panning 64 this.setMap(s). cxlvi .setXY(mb.addY(5).setMap(s).getY()>=(mb.getCanvasHeight()-5) selP. mb.getPixLon().addX(5).getY()>0 && selP.getX()<=6) { 51 // calculation of (deg.getNewEdge().min.getNewEdge().getPixLat()).subX(5). 43 //calculation of new Selector position on panned map 44 selP.mb.min.getX()>6) selP.getCanvasWidth()-5) { 33 // calculation of (deg.mb.sec) for Selector before panning 34 //dakle ja pre panovanja izracunam svetske koordinate selektora. mb.getX()<mb.mb.setDrawablePoints().getCanvasHeight()-5)) { 63 //calculation of (deg.mb.getPixLat()).getX()>mb.setDrawablePoints(). pa kad panujem mapu (a samim 36 //tim i promenim njen newEdge onda odredjujem i relativni polozaj 37 //selektorske tacke u odnosu na taj newEdge (jasno je da pri panovanju mape 38 //nije doslo do promene svetskih koordinata selektora) 39 this.

setDrawablePoints(). 88 89 if (!WP.equals("selector") && colorSet==true) { 94 resetColor(). 104 * so when map has to be panned we need to find out (lat. 99 } 100 101 102 103 /** When selector is moved we only update its (x. 95 resetBig().getImage().getName().subY(5).getNewEdge().getName(). 98 //if ((WP.equals("route") && big==false) setBig(). 70 71 } 72 } 73 if(s=='u'){ 74 if (selP.lon) pair 105 * for selector on old screen and adjust its position (x'.getPixLat()). 83 84 } 85 } 86 87 Point WP = this.getPixLon(). 75 if (selP.y') on new screen 106 * in a way that (lat. 91 setBig().getNewEdge().equals("blanco")|| WP.getY()<=6) { 76 //calculation of (deg. 92 } 93 if (WP. 80 mob.setXY(mb.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 65 66 67 68 //Paning mb.setXY(mb.lon) is unchanged cxlvii . 81 //calculation of new Selector position on panned map 82 selP.setDrawablePoints(). //calculation of new Selector position on panned map 69 selP.mb.sec) for Selector before panning 77 this.setMap(s).getPixLat()).setSelectorWorld(mb.mb.mb. mb.getSelectedWP(). 78 //Paning 79 mb.setMap(s).getY()>6) selP.getPixLon().getImage().getPixLon(). 96 } 97 //if (!WP. mob.getPixLat()).mb.min.equals("route")) && big==true) resetBig().getNewEdge().getImage().equals("selector") && colorSet==false) { 90 setColor().equals("blanco") && ! WP.getImage().y) 'descriptors'.mb.

getX().true). 119 MathFP. long pixLat){ 109 110 // pamtim trenutno x i y 111 long tx = selP.setSelectorWorld(mb.setY(ty). 116 long dLonSec = MathFP. long pixLon.getX().getY())).setX(tx).mul(pixLon.getPixLon(). 132 133 copy. 134 return copy. 120 121 // vracam trenutno x i y 122 selP. 112 long ty = selP.toFP(selP.getX())).getY(). 123 selP.getPixLat()).Zarko Acimovic 107 */ 108 public void setSelectorWorld(Point edge.MathFP. 131 Point copy = new Point(selP.setName("").toFP(selP.mb.getY().getLatSec().false).mb. 113 114 // azuriram svetske kordinate 115 long dLatSec = MathFP.""."". 142 } 143 144 /** Returns y-coordinate of selector 145 * @return long 146 */ 147 long getSelY(){ 148 return selP.add(edge.dLonSec).mul(pixLat.MathFP. 117 118 selP = new Point(MathFP. cxlviii .dLatSec).getDrawablePoints().getLonSec(). 135 } 136 137 /** Returns x-coordinate of selector 138 * @return long 139 */ 140 long getSelX(){ 141 return selP.getNewEdge(). 149 } 150 151 /** Returns user selected Point 152 * @return Point 153 */ 154 public Point getSelectedWP(){ 155 Vector v = mob.sub(edge. 124 } 125 126 /** Returns copy of SELECTOR Point 127 * @return Point 128 */ 129 public Point getSelector(){ 130 this.

159 if( Math. i<freeWPV.getX()-selP.indexOf('_'). 162 i=1000.elementAt(k).size(). 166 } 167 168 169 /** Returns user selected Point with name s 170 * @return Point 171 */ 172 public void selectWP(String s) { 173 174 int len = s. 176 if(blanco!=-1){ 177 String idS = s.false).getX())<5 && 160 Math. 203 } 204 } 205 if(k==-2){ cxlix .s.getFreeWaypoints(). 186 PVector freeWPV = mob.equals(wp.blanco). 183 if(blank!=-1 && s.length()). 187 188 int k=-2. i<v. 193 look4 = (Point) freeWPV. 184 185 Point look4 = null. 163 } 164 } 165 return ret.equals("current")) s = s. 178 s = s. i++){ 190 Point wp = (Point) freeWPV. 175 int blanco = s. 189 for(int i=0.len).equals(cP.indexOf(' '). 180 } 181 182 int blank = s.abs(fWhs.getCurrentPosition().getY())<5 ) { 161 ret=fWhs. 179 s = compact(s)."s".substring(blank+1.abs(fWhs. 194 i=1000.length().getName())){ 192 k=i. 195 } 196 } 197 198 if(k==-2){ 199 Point cP = mob.0.elementAt(i). 202 k=-3. i++){ 158 Point fWhs = (Point) v."selector".getY()-selP. 157 for(int i=0. 191 if(s.blank).substring(0.substring(blanco+1.size().getName())) { 201 look4=cP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 156 Point ret = new Point(0.substring(0. 200 if(s.elementAt(i).

getRoutes().getPixLat()). 223 i=1000. 220 if(wp.elementAt(j).size().equals("blanco") && big==true) resetBig().getImage().equals(dP. 210 } 211 } 212 213 if(k==-2){ 214 Vector routes = mob. 235 selP.getImage(). 239 240 this.getPixLon().getName(). i++){ 216 PVector rt = (PVector) routes.equals("blanco") && big==false) setBig(). 241 } 242 243 /** Deletes selected Point 244 * Returns -4 if current Point is deleted 245 * Returns -3 if destination Point is deleted 246 * Returns -2 if free Point deleted 247 * Returns -1 if more then one Point is selected 248 * Returns 0 if none Point is selected 249 * Returns n if n-th Point in route deleted 250 */ 251 public int deleteWP(){ 252 int ret = 0.mb.out.elementAt(j). j++){ 218 Point wp = (Point)rt.setColor().getNewEdge().false). 224 j=1000. 233 234 mob.getName())) { 208 look4=dP.println(wp). mb.mb. 253 254 this. mb. 255 cl . j<rt.setXY(mb.selP = new Point(look4. 236 237 if (!selP. 222 look4=(Point)rt. 219 System.elementAt(i). 217 for(int j=0. 209 k=-4.getNewEdge(). i<routes.Zarko Acimovic 206 Point dP = mob. 215 for(int i=0.setSelectorWorld(mb.setDrawablePoints(). 238 if (selP. 231 232 mb.setBackground(look4). 207 if(s.size().getPixLon().getPixLat()).getDestinationPosition().equals(s)){ 221 k=j. 225 } 226 } 227 } 228 } 229 230 this.

283 if ( (temp1.getY()-fwp.size()+temp2.size()+temp2.getIndex().getTypeID())). 294 ret=dr.getIndex()).wpR. j<Routes.abs(selP.getX())<5 && Math.intValue().getX()-wpR.size(). 286 int d = k.getX())<5 && Math. i<fWP. 284 if ( temp1. 271 if( Math.getX())<5 && 299 Math. 298 if( Math. 292 PVector vR = (PVector) Routes.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 256 Vector temp1 = new Vector().size()>0){ 279 drt = (DelRoute) temp2. j++){ 268 PVector vR = (PVector) Routes. 278 if(temp2.size(). 258 for (int i=0.getY())<5 ) { 272 temp2. 293 vR.getY())<5 ){ 261 temp1. 295 } 296 297 Point cp = mob. 301 ret= -4. 257 PVector fWP = mob.abs(selP.getRoutes(). i++){ 259 Point fwp = (Point)fWP.size()==1 ) { 285 Integer k = (Integer) temp1.abs(selP. k<vR.elementAt(0).elementAt(dr.elementAt(j).getX()-cp.size())> 1 ) ret=-1.abs(selP.getX()-fwp. 262 } 263 } 264 265 Vector temp2 = new Vector(). 280 } 281 282 if ( (temp1. 273 } 274 } 275 } 276 277 DelRoute drt = null.abs(selP.getRouteID()-1).size().addElement(new Integer(i)). 287 fWP.removeElementAt(d).resetCurrentPosition(). 260 if( Math.getCurrentPosition().getY()-wpR. 266 Vector Routes = mob. 269 for (int k=0.getY())<5 ) { 300 mob.elementAt(k).getFreeWaypoints().getY()-cp. k++){ 270 Point wpR = (Point)vR.size()==1 ){ 291 DelRoute dr = (DelRoute) temp2.size())==0 ) ret=0.removeElementAt(dr.addElement(new DelRoute(k. 267 for (int j=0.abs(selP. 302 } 303 cli .elementAt(i).elementAt(0). 288 ret=-2.elementAt(0). 289 } 290 if( temp2.

340 mb.getPixLon().mb. 336 selP.getY()>mb. 323 while (selP.mb.mb.getPixLat()). 309 ret= -3. 322 selP.getZoomLevel()+1.getPixLon().setSelectorWorld(mb.mb.getX()<0){ 334 this.setSelectorWorld(mb.getPreviousPixLon().getCanvasHeight()) { 329 this.setXY(mb. 305 306 if( Math.getNewEdge().Zarko Acimovic 304 Point dp = mob. mb.setXY(mb.abs(selP.getPixLon(). 327 } 328 while (selP.mb.mb. 337 } 338 while (selP.mb.setMap('d').setMap('r').getPixLat()).getX()>mb.getPixLat()). 330 mb.getX()-dp.resetDestinationPosition().mb.getNewEdge().getPixLon(). 341 selP.getCanvasWidth()) { 324 this.getPixLat()). 325 mb.mb.getNewEdge(). 332 } 333 while (selP.getPixLat()). clii . 310 } 311 312 resetColor(). 313 314 return ret. 315 } 316 317 318 /** Action that must be taken with Selector when Zoom In/Out 319 */ 320 public void Zoom(){ 321 this.getNewEdge().getPixLon().mb.getNewEdge().abs(selP. 342 } 343 } 344 345 346 /** Draws selector point 347 * 348 public void drawSelPOld(Graphics g){ 349 long zl = mb.getNewEdge(). mb.mb. mb.setSelectorWorld(mb.mb.getPixLon().getNewEdge().getNewEdge().mb.getY()<0) { 339 this.setXY(mb.getPixLon().setSelectorWorld(mb. 326 selP.getY())<5 ) { 308 mob.getPixLat()).getDestinationPosition().mb.setXY(mb.setMap('u').getPixLat()). mb. mb.setXY(mb.mb.getPreviousPixLat()).getPixLat()).getPixLon().getPreviousEdge().getPixLon().getY()-dp. 331 selP. 335 mb.getPixLat()).setMap('l').getX())<5 && 307 Math.setSelectorWorld(mb.getNewEdge().

15.parseInt(zzl.getYY()-7.6.6).setColor(m.n.16).setColor(0.16.0.fillRect(selP.drawRect(selP.drawRect(selP.fillRect(selP.n.toString()).getYY()-13.getXX()-13.selP. 398 g.fillRect(selP.0.parseInt(zzl.selP.7). 356 g.15). 391 g.fillRect(selP.n.0.6.s).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 350 Long zzl = new Long(zl).fillRect(selP.16).16. 367 g.14. 355 g.6).selP.selP.getYY()-6.parseInt(zzl.getXX()-8.16. 364 int zoomL = Integer. 399 g.selP.getYY()-3.getYY()-8.selP.drawRect(selP.n.selP.getYY()-4.getXX()-3. 386 if(big==false){ 387 g.getZoomLevel()+1.s).7.25 cliii .getXX()-3. 372 g.15).s).getXX()-7.setColor(m.fillRect(selP.fillRect(selP.16).getZoomLevel()+1.7).32 sad je 16.8.getXX()-8.0).selP. 366 g.8). 357 } 358 359 /** Draws selector point 360 * 361 public void drawSelPOld1(Graphics g){ 362 long zl = mb. 392 g. 353 g.setColor(m.0). 395 g. 368 g.selP.getYY()-5. 373 g.getXX()-4.getXX()-4.fillRect(selP.12).///umesto 16.toString()). 390 g.setColor(0.7.getXX()-8.selP.getXX()-5.s). 352 g.getYY()-7.setColor(0.s).getYY()-4. 369 g.getXX()-4.fillRect(selP.0.getYY()-8.n.selP.selP.selP. 374 375 g.setColor(m. 384 //Long zzl = new Long(zl).setColor(m.getYY()-3. 354 g.5).fillRect(selP. 376 377 378 } 379 380 /** Draws selector point 381 * 382 public void drawSelPobsolete(Graphics g){ 383 //long zl = mb.14).toString()). 385 //int zoomL = Integer.15.getYY()-3.22).getXX()-7.0).getYY()-4.15.getXX()-6.0.getXX()-3.getYY()-8. 394 g.12.selP.8).0). 388 g.setColor(0.33.s).7.n. 363 Long zzl = new Long(zl). 351 int zoomL = Integer.selP.getYY()-8.setColor(0. 371 g. 365 g.getXX()-8. 389 g. 370 g.setColor(m.drawRect(selP.0).getYY()-4.selP. 396 } else { 397 g. 393 g.7).getXX()-4.drawRect(selP.8.fillRect(selP.

436 } 437 g.getSelectedWP().n.getSelectedWP().drawRect(selP.getXX()-4*length.setColor(m.getName().getXX()-4.selP. 401 g.getYY()-7.14.getYY()-4.selP.selP.getName().getSelectedWP().17).n.drawRect(selP.getXX()15.drawRect(selP.0).14).getXX()-5.setColor(255.fillRect(selP.getXX()-7.getYY()-12.0).selP.fillRect(selP.getYY() +12.getSelectedWP().selP.fillRect(selP. 423 //g. 406 407 //g.getYY()-4.this.0).getXX()-12.getYY()-5.getYY()-3.n.getYY()-13.selP.getXX()-4.setColor(0.s). 432 //g. 405 g.selP.32 sad je 16.getSelectedWP().0).selP.getYY()+11. 420 g.setColor(m. 430 //g. 439 */ 440 } 441 442 public void drawCaption(Graphics g){ 443 int length=0.drawString(this. 424 g. 433 String name = this.6).selP.15.getXX()-13.getXX()-4.s).getXX()-6. 415 416 //g.25 403 g.22).fillRect(selP.16).selP.setColor(255.drawString(this.getYY()-4.0.getName().drawRect(selP. 427 /** 428 if(big==true){ 429 g.getXX()-4*length-2. 408 } 409 g.14).8*length+2.22).setColor(m. 438 if (!this.equals("selector")) g.equals("selector")) g. 421 g.7.getXX()-15.0.length().getYY()-8.getName().getSelectedWP().6.setColor(m.getYY()-8.15). 435 g.///umesto 16.selP.setColor(0. 410 if (!this.getYY()-5.drawRect(selP.selP.5).selP. 404 g.selP.7).15).fillRect(selP. 431 //g.s).this.selP.19).getXX()-3.15.15. cliv .setColor(0.180.drawRect(selP.getYY() +11. 434 length = name.16.0).7).0). 417 g. 426 g.7.selP.getYY() +13.setColor(0.32.fillRect(selP.getXX()-4. 422 g.fillRect(selP.getYY()-4.0).0). 419 g.getSelectedWP().n.Zarko Acimovic 400 g.19.0.selP.selP.getName().0. 411 }*/ 412 413 public void drawSelP(Graphics g){ 414 int length=0.getYY()-6. 418 g.s).17. 425 g.getXX()-8.33. 402 g.drawRect(selP.15).getXX()-5.getName().getXX()-8.drawString(selP.15.0).180.

448 //g.setDestinationPosition(wp).selP.getYY()-4. 446 //g. 483 s=0.getXX()-6.selP.getSelectedWP().getXX()-4*length.selP.drawRect(selP.19).getSelectedWP().drawRect(selP.0.selP. 452 //if (!this.17.getName(). 489 colorSet=false.getSelectedWP().setCurrentPosition(wp).setColor(0. clv .getXX()-4*length-2.selP. 447 //g.getYY()-6.getYY() +13.0).getXX()-5.getSelectedWP(). 473 } 474 475 public void setColorOld(){ 476 s = 0. 477 colorSet=true.length(). 478 } 479 480 public void setColor(){ 481 m=255.equals("selector")) g. 482 n=255.19.17).getYY() +12.15.getName().0).selP.n.fillRect(selP.getXX()-4.getSelectedWP(). 484 colorSet=true.equals("selector")) g. 454 if (!this.getSelectedWP(). 451 g.s).getName(). 449 String name = this.drawString(this.selP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 444 if(big==true){ 445 g.8*length+2. 455 } 456 457 } 458 459 460 461 /** Sets current position 462 */ 463 public void setCurrent(MapObjects mob){ 464 Point wp = this. 465 mob.getYY() +13.setColor(m.getYY()-5.14).getName(). 466 } 467 468 /** Sets destination position 469 */ 470 public void setDest(MapObjects mob){ 471 Point wp = this.selP.getName().drawString(this. 485 } 486 487 public void resetColorOld(){ 488 s = 255. 453 g.getXX()-4*length.getSelectedWP().0). 450 length = name.drawRect(selP.15). 472 mob.

characters with integer representation between 0 and 33 can not be printed out in WSDD console. Integer representations of blanko characters are 9 and 32 Also.Zarko Acimovic 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 } public void resetColor(){ m=255. s=0. for(int i=0. return ret.length(). i++){ int temp = (int)d[i]. so I excluded them too public String compact(String s){ int k = s. n=180.toCharArray(). } } clvi . if(temp>32) ret+=d[i].length().length. } public void setBig(){ big=true. colorSet=false. } int kk = ret. char[] d = s. i<d. String ret = "".println("Bugger is: "+s). } public void resetBig(){ big=false. if (kk!=k) System. } /** * * * */ Blanco characters are possible to occur in names of pictures.out.

048 0.107 0.36 0.2049568079 0.1857260387 0.667 152 0.0490881667 0.9909 1.29 1 0.4 54 1 78 0.923 0.16 1 0.1174071027 0.143 0.5 0 0.2540449746 0.145 0.33 0 0.068318936 0.4 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) clvii LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.917 19 0.889 1 0.381 90 0.18 33 0.068318936 0.207 0.29 27 0.0490881667 0.875 1 0 0 0 1 0.077 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.3 0.1366378719 0.037 0.1366378719 0.991 1 1 0 0 0 0 0.67 2 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .334 25 0.5 1 0.4696 0 0.875 5 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.068318936 0.1429 0.929 0 0.068318936 0 0.86 0 1 5 0.03 0.0490881667 0.4696284108 0 0.074 0.864 1 1.9 1 1 0.29 0 0 0.556 0 0 31 0.436 0 0.1366378719 0.25 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.67 152 0.0490881667 0.2049568079 0.0981763335 0.75 0 0.

arisa. Locality of Data Description The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class.se/compendium/node112.*.microedition.lcdui. clviii .microedition.*.java 1 2 3 4 5 6 7 8 9 10 11 /** * Simple text form */ import javax. http://www. //import java.*.io.Zarko Acimovic Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions SimpleTextForm has problem with Locality of Data.midlet. //import javax. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability.html SimpleTextForm.

this.8.0)."". } } /** Returns the name of waypoint * @return String */ public String getName(){ return nameWP.null)."".8. /** Creates new form */ SimpleTextForm(boolean createChgr){ super("Data Input"). } /** Sets the name of waypoint */ clix .1. } /** Returns the type of waypoint * @return String */ public String getType(){ return typeWP. /** Type of waypoint */ TextField typeWP. typeWP = new TextField("Type".*. ChoiceGroup chgr.util. this.append(chgr).append(typeWP).append(nameWP). this.getString(). chgr = new ChoiceGroup("".str.getString(). str[1] = "Out of Sync". String[] str = new String[2]. nameWP = new TextField("Name". public class SimpleTextForm extends Form{ /** Name of waypoint */ TextField nameWP. if(createChgr==true){ str[0] = "Sysnchronized Following".0).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 //import java.

setLabel(s).4 0.16 1 0.1366378719 0.4696284108 0 0.03 0.4696 0 0.29 27 0.917 19 0.1366378719 0.0490881667 0.36 0. } } Maintainability 0.0490881667 0.setString(s).2049568079 0.145 0.33 0 0.556 0 0 31 0.2049568079 0.0981763335 0.667 152 0.1174071027 0.074 0.864 1 1.5 1 0.207 0. } public int getSelected(){ return chgr.048 0. } public void setLabel2(String s){ typeWP. } /** Sets the type of waypoint */ public void setType(String s){ typeWP.Zarko Acimovic 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString public void setName(String s){ nameWP.3 0.setLabel(s).077 0 0.4 54 1 78 0.381 90 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .875 1 0 0 0 1 0.1366378719 0.068318936 0 0. } public void setLabel(String s){ nameWP.068318936 0.037 0.29 0 0 0.0490881667 0.334 25 0.2540449746 0.929 0 0.9909 1.1857260387 0.18 33 0.9 1 1 0.67 2 0.67 152 0.29 1 0.068318936 0.setString(s).107 0.86 0 1 5 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.875 5 0.068318936 0.75 0 0.889 1 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.25 0.143 0.0490881667 0.5 0 0.getSelectedIndex().991 1 1 0 0 0 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) clx LD 0.436 0 0.1429 0.923 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation clxi .

//import java. Description The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class.arisa.midlet.io.se/compendium/node118. //import javax. That is the relative number of directly connected public methods in the class.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 /** * Text form */ import javax.*.util.se/compendium/node112. http://www.Zarko Acimovic Lack Of Documentation (LOD) Code Conventions Locality of Data.*. Classes having a low cohesion indicate errors in the design.*. TextField lon. /** ChoiceGroup of categories */ ChoiceGroup chgr.arisa. public class TextForm extends Form{ /** Name of waypoint */ TextField nameWP.html Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class. /** Type of waypoint */ TextField typeWP.*. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability. //import java.microedition. TextField lat. http://www. /** Creates new form clxii .microedition.html TextForm.lcdui.

"".50. this. this. this.null).0).0).50.append(chgr).append(chgr). boolean first){ super("Data Input")."". lat = new TextField("Latitude". lon = new TextField("Longitude". } } /** Returns the name of waypoint * @return String */ public String getName(){ return nameWP.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 */ TextForm(String[] s. } /** Returns the type of waypoint * @return String */ public String getType(){ return typeWP.getString().null). } /** Sets the name of waypoint */ public void setName(String s){ nameWP."". } /** Sets the type of waypoint clxiii ."".0).0).50."". typeWP = new TextField("Type".append(typeWP).append(lon).1.getString().append(nameWP).append(""). this.s.s. chgr = new ChoiceGroup("Category".0).50. chgr = new ChoiceGroup("Category:". lon = new TextField("Longitude".1. this. this.setString(s).append(lon). nameWP = new TextField("Name". this.50.0). this. this.append("").50."".append(lat). }else{ lat = new TextField("Latitude". if(first = false){ //this.append(lat).

} public int getSelected(){ return chgr. } } clxiv .setString(s). } public String getLat(){ return lat.getString().Zarko Acimovic 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 */ public void setType(String s){ typeWP.setString(MathFP. } public void setLon(long s){ lon. } public String getLon(){ return lon.setString(MathFP.toString(s)).getSelectedIndex(). } public void setLat(String s){ lat.setString(s).getString().setString(s).toString(s)). } public void setLat(long s){ lat. } public void setLon(String s){ lon.

3 0.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString Maintainability 0.875 5 0.381 90 0.1429 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .889 1 0.1857260387 0.16 1 0.068318936 0 0.068318936 0.9909 1.2049568079 0.29 0 0 0.33 0 0.334 25 0.1366378719 0.67 152 0.4 54 1 78 0.29 1 0.068318936 0.923 0.875 1 0 0 0 1 0.18 33 0.0490881667 0.86 0 1 5 0.436 0 0.5 1 0.048 0.5 0 0.1366378719 0.4696284108 0 0.0490881667 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 LD 0.29 27 0.145 0.074 0.107 0.556 0 0 31 0.667 152 0.36 0.0981763335 0.1174071027 0.207 0.864 1 1.2049568079 0.75 0 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.991 1 1 0 0 0 0 0.1366378719 0.0490881667 0.67 2 0.0490881667 0.929 0 0.4696 0 0.25 0.9 1 1 0.068318936 0.143 0.4 0.917 19 0.03 0.2540449746 0.037 0.077 0 0.285 0 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) clxv LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.

Zarko Acimovic Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class. //import javax. Classes having a low cohesion indicate errors in the design.*.microedition. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability.*.lcdui.java 1 2 3 4 5 6 7 8 /** * Text form */ import javax.arisa. Description The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class.arisa.se/compendium/node118.microedition. http://www. clxvi .html Locality of Data. That is the relative number of directly connected public methods in the class. http://www.midlet.html TextFromFriend.se/compendium/node112.

io. typeWP = new TextField("Type".util.8.getString().*. this. } /** Returns the type of waypoint * @return String */ public String getType(){ return typeWP. } clxvii .append(typeWP).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 //import java."".setString(s). } public void setLabel(String s){ nameWP. public class TextFormFriend extends Form{ /** Name of waypoint */ TextField nameWP.getString(). this.setLabel(s).0).append(nameWP).8."".0). /** Creates new form */ TextFormFriend(){ super("Data Input").*. } /** Sets the name of waypoint */ public void setName(String s){ nameWP. /** Type of waypoint */ TextField typeWP. nameWP = new TextField("Name". //import java. } /** Returns the name of waypoint * @return String */ public String getName(){ return nameWP.

068318936 0.29 0 0 0.86 0 1 5 0.556 0 0 31 0.207 0.0490881667 0.2540449746 0.5 0 0.1366378719 0.991 1 1 0 0 0 0 0.107 0.2049568079 0.0490881667 0.667 152 0.917 19 0.1366378719 0.048 0.875 1 0 0 0 1 0.381 90 0.923 0.143 0.4696 0 0.3 0.929 0 0.1857260387 0.36 0.29 1 0.Zarko Acimovic 60 61 62 63 64 65 66 Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString /** Sets the type of waypoint */ public void setType(String s){ typeWP.889 1 0.25 0.1366378719 0.67 152 0.2049568079 0.864 1 1.67 2 0.0981763335 0.33 0 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity clxviii LD 0.75 0 0.068318936 0.077 0 0.9909 1.setString(s).0490881667 0.068318936 0 0.03 0.068318936 0.145 0.4696284108 0 0.5 1 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .074 0.037 0.1174071027 0.9 1 1 0.29 27 0.436 0 0.0490881667 0.4 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0. } } Maintainability 0.4 54 1 78 0.1429 0.18 33 0.16 1 0.875 5 0.334 25 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions clxix .

public class TextFormImage extends Form{ /** Name of waypoint */ TextField nameWP.*. /** Type of waypoint */ TextField typeWP.html Locality of Data. Classes having a low cohesion indicate errors in the design. That is the relative number of directly connected public methods in the class. //import javax. //import java.arisa. http://www.se/compendium/node112. /** Category of waypoit */ // TextField catWP.util.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 /** * Text form for ChoicGroup with images */ import javax.Zarko Acimovic Documentation Lack Of Documentation (LOD) Code Conventions Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class.midlet.*.html TextFormImage.*.io.*.se/compendium/node118. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability. /** ChoiceGroup of categories */ // TextField lat.microedition.arisa.microedition. clxx . http://www.lcdui. Description The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class. //import java.

getString(). ChoiceGroup chgr.append(nameWP). clxxi . } /** Returns the name of waypoint * @return String */ public String getName(){ return nameWP.getString().setString(MathFP. } public void setNameCHGR(String s){ chgr.append(""). Image[] img){ super("Data Input").img).s. this. } public void setLat(long s){ //lat.toString(s)).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 // TextField lon. chgr = new ChoiceGroup(nameChg. } /** Sets the type of waypoint */ public void setType(String s){ typeWP. this. this.append(chgr)."".getSelectedIndex(). /** Creates new form */ TextFormImage(String nameChg. } /** Returns the type of waypoint * @return String */ public String getType(){ return typeWP.0). nameWP = new TextField("Name".setString(s). } /** Sets the name of waypoint */ public void setName(String s){ nameWP.setLabel(s). } public int getSelected(){ return chgr. String[] s.1.setString(s).50.

0981763335 0. } } Maintainability 0.75 0 0.setString(MathFP.2049568079 0.86 0 1 5 0.0490881667 0.929 0 0.083 0 WMC 142 59 20 3 70 13 40 51 95 6 5 12 11 18 142 71 9 7 1 27 8 16 13 .4696284108 0 0.334 25 0.0490881667 0.889 1 0.67 152 0.667 152 0.068318936 0.9 1 1 0.864 1 1.068318936 0.4696 0 0.145 0.29 0 0 0.5 1 0.068318936 0.037 0.556 0 0 31 0.143 0.285 0 LEN 10 13 7 8 10 13 7 5 6 12 14 10 8 13 10 13 6 14 20 10 13 11 17 LOC 1356 616 103 23 370 291 313 699 440 52 52 175 103 173 1356 520 50 70 32 125 75 266 80 LOD_Class MPC 0.991 1 1 0 0 0 0 0.1366378719 0.36 0.074 0.03 0.2540449746 0.4 0.875 1 0 0 0 1 0.917 19 0.29 1 0.068318936 0 0.1857260387 0.25 0.29 27 0.33 0 0.381 90 0.1429 0.1366378719 0.9909 1.048 0.107 0.67 2 0.1174071027 0.1366378719 CBO 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 CYC_Classes 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 DAC 15 2 5 0 5 3 3 2 0 1 0 0 1 5 15 6 1 0 1 0 0 1 0 DIT ILCOM LCOM 0 2 75 0 4 480 0 1 3 0 1 0 0 1 311 0 1 0 0 3 255 0 10 1164 0 1 732 0 1 0 0 2 0 0 10 112 0 5 67 0 3 37 0 2 75 0 1 70 0 3 20 0 3 11 0 1 0 0 0 169 0 3 40 0 4 68 0 0 25 Complexity Size Lines of Code (LOC) Interface Complexity Number of Attributes and Methods (SIZE2) Number Of local Methods (NOM) Structural Complexity McCabe Cyclomatic Complexity (CC) Weighted Method Count (WMC) Response For a Class (RFC) Architecture and Structure Inheritance Depth of Inheritance Tree (DIT) clxxii LD 0.3 0.0490881667 0.167 0 NAM 134 77 21 5 41 26 21 60 46 3 7 23 16 16 134 28 12 11 2 13 11 21 6 NOC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NOM 11 30 11 3 29 3 17 38 34 2 5 12 11 7 11 20 8 7 1 13 8 10 5 RFC 95 40 27 3 53 14 32 45 34 6 5 12 12 11 95 63 9 7 1 13 8 20 5 TCC 0.2049568079 0.077 0 0.4 54 1 78 0.207 0.Zarko Acimovic 84 85 86 87 88 89 Class Name MapsMIDlet MapBackground Outlook DelRoute MapObjects CompassCanvas PVector Point MathFP ImageCanvas3 TextFormFriend TextFormWP TextForm Thread4Friend MapsMIDlet SelectorPoint Friend SimpleTextForm MapBackgroundFactory HeapSorter TextFormImage Coordinates CommaHyphenString } public void setLon(long s){ //lon.0490881667 0.16 1 0.875 5 0.18 33 0.436 0 0.5 0 0.1366378719 0.923 0.toString(s)).

se/compendium/node118.html Improvement of LCOM Description The Improvement of LCOM (cf. http://www. That is the relative number of directly connected public methods in the class.se/compendium/node112. Classes having a low cohesion indicate errors in the design. http://www. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability.arisa.2.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin Number Of Children (NOC) Coupling Afferent Coupling (Ca) Coupling Between Objects (CBO) Change Dependency Between Classes (CDBC) Change Dependency Of Classes (CDOC) Efferent Coupling (Ce) Coupling Factor (CF) Data Abstraction Coupling (DAC) Instability (I) Locality of Data (LD) Message Passing Coupling (MPC) Package Data Abstraction Coupling (PDAC) Cohesion Lack of Cohesion in Methods (LCOM) Improvement of LCOM (ILCOM) Tight Class Cohesion (TCC) Design Guidelines and Code Conventions Documentation Lack Of Documentation (LOD) Code Conventions Tight Class Cohesion Description The Tight Class Cohesion metric measures the cohesion between the public methods of a class.3) metric is a measure for the number of clxxiii .html Locality of Data. Lack of Cohesion in Methods 3. Description The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class.arisa.

midlet. /** Type of waypoint */ TextField typeWP. /** Minutes of latitude */ TextField minLat.*. //import java. //import java. The less separate components there are the higher is the cohesion of the methods in the class.*.*.Zarko Acimovic connected components in a class.arisa. clxxiv .io.se/compendium/node117.microedition.*. A component are methods of a class sharing (being connected by) instance variables of the class.util.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 /** * Text form for insertion of waypoint */ import javax. http://www. public class TextFormWP extends Form{ /** Name of waypoint */ TextField nameWP.html TextFormWP. /** Degrees of latitude */ TextField degLat.microedition.lcdui. //import javax. /** Side NORTH / SOUTH */ TextField sideNS. /** Seconds of latitude */ TextField secLat.

degLat = new TextField("Degrees of Latitude".8.8."".8. North or South?". secLat = new TextField("Seconds of Latitude". this. this. this. sideNS = new TextField("Side. clxxv .append(sideNS). this.12.0).0). this. nameWP = new TextField("Name"."". /** Side WEST / EAST */ TextField sideWE. /** Seconds of longitude */ TextField secLon."". typeWP = new TextField("Type". this."".append(typeWP).0).append(degLat).0)."".""."". this.8. degLon = new TextField("Degrees of Longitude".12.0). minLon = new TextField("Minutes of Longitude".8. /** ChoiceGroup of categories */ ChoiceGroup chgr.append(minLon).0).append(secLat). minLat = new TextField("Minutes of Latitude". /** Creates new form */ TextFormWP(String[] s){ super("Data Input"). /** Minutes of longitude */ TextField minLon.8.0).Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 /** Degrees of longitude */ TextField degLon.append(minLat)."". this.0).append(nameWP).append(degLon).

parseInt(degLat. this."".getString()). } /** Returns the type of waypoint * @return String */ public String getType(){ return typeWP.0).append(chgr).append(sideWE). this.append(secLon).parseInt(minLat. return r. } /** Returns degrees of latitude */ public int getDegLat(){ int r = Integer.8.null). return r.getString()).1. } /** Sets the name of waypoint */ public void setName(String s){ nameWP.setString(s). this. sideWE = new TextField("Side.getString().getString(). chgr = new ChoiceGroup("Categories".s.Zarko Acimovic 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 secLon = new TextField("Seconds of Longitude".8. } /** Returns minutes of latitude */ public int getMinLat(){ int r = Integer. } /** Sets the type of waypoint */ public void setType(String s){ typeWP.setString(s).0). } /** Returns the name of waypoint * @return String */ public String getName(){ return nameWP. } clxxvi ."". West or East?".

getString()). } /** Returns side. return k. return r. return r. } /** Returns seconds of longitude */ public int getSecLon(){ int r = Integer. char[] c = s. return k. } /** Returns side.Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 /** Returns seconds of latitude */ public int getSecLat(){ int r = Integer. char k = c[0].getString(). } /** Returns minutes of longitude */ public int getMinLon(){ int r = Integer.getString()). } } clxxvii . West or East */ public char getSideWE(){ String s = sideWE. char[] c = s.toCharArray(). } /** Returns degrees of longitude */ public int getDegLon(){ int r = Integer.parseInt(secLat. North or South */ public char getSideNS(){ String s = sideNS.parseInt(degLon.parseInt(secLon.getString(). char k = c[0].getString()). return r.getString()).toCharArray().parseInt(minLon. return r.

Zarko Acimovic

Class Name
MapsMIDlet
MapBackground
Outlook
DelRoute
MapObjects
CompassCanvas
PVector
Point
MathFP
ImageCanvas3
TextFormFriend
TextFormWP
TextForm
Thread4Friend
MapsMIDlet
SelectorPoint
Friend
SimpleTextForm
MapBackgroundFactory
HeapSorter
TextFormImage
Coordinates
CommaHyphenString

Maintainability
0.4696
0
0.0490881667
0.068318936
0
0.0490881667
0.068318936
0.2540449746
0.0981763335
0.0490881667
0.068318936
0.2049568079
0.1366378719
0.1174071027
0.4696284108
0
0.0490881667
0.068318936
0.2049568079
0.1857260387
0.1366378719
0.1366378719
0.1366378719

CBO
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

CYC_Classes
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

DAC
15
2
5
0
5
3
3
2
0
1
0
0
1
5
15
6
1
0
1
0
0
1
0

DIT ILCOM LCOM
0
2
75
0
4
480
0
1
3
0
1
0
0
1
311
0
1
0
0
3
255
0
10
1164
0
1
732
0
1
0
0
2
0
0
10
112
0
5
67
0
3
37
0
2
75
0
1
70
0
3
20
0
3
11
0
1
0
0
0
169
0
3
40
0
4
68
0
0
25

Complexity
Size
Lines of Code (LOC)
Interface Complexity
Number of Attributes and Methods (SIZE2)
Number Of local Methods (NOM)
Structural Complexity
McCabe Cyclomatic Complexity (CC)
Weighted Method Count (WMC)
Response For a Class (RFC)

Architecture and Structure
Inheritance
Depth of Inheritance Tree (DIT)
Number Of Children (NOC)
Coupling
Afferent Coupling (Ca)
Coupling Between Objects (CBO)
Change Dependency Between Classes (CDBC)
Change Dependency Of Classes (CDOC)
clxxviii

LD
0.9909
1.923
0.9
1
1
0.864
1
1.3
0.875
1
0
0
0
1
0.991
1
1
0
0
0
0
0.285
0

LEN
10
13
7
8
10
13
7
5
6
12
14
10
8
13
10
13
6
14
20
10
13
11
17

LOC
1356
616
103
23
370
291
313
699
440
52
52
175
103
173
1356
520
50
70
32
125
75
266
80

LOD_Class MPC
0.667
152
0.29
27
0.917
19
0.75
0
0.4
54
1
78
0.334
25
0.18
33
0.86
0
1
5
0.33
0
0.077
0
0.67
2
0.875
5
0.67
152
0.381
90
0.889
1
0.5
0
0.5
1
0.929
0
0.556
0
0
31
0.167
0

NAM
134
77
21
5
41
26
21
60
46
3
7
23
16
16
134
28
12
11
2
13
11
21
6

NOC
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

NOM
11
30
11
3
29
3
17
38
34
2
5
12
11
7
11
20
8
7
1
13
8
10
5

RFC
95
40
27
3
53
14
32
45
34
6
5
12
12
11
95
63
9
7
1
13
8
20
5

TCC
0.1429
0.207
0.436
0
0.29
1
0.037
0.074
0.16
1
0.4
0.03
0.145
0.048
0.143
0.36
0.25
0.29
0
0
0.107
0.083
0

WMC
142
59
20
3
70
13
40
51
95
6
5
12
11
18
142
71
9
7
1
27
8
16
13

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin

Efferent Coupling (Ce)
Coupling Factor (CF)
Data Abstraction Coupling (DAC)
Instability (I)
Locality of Data (LD)
Message Passing Coupling (MPC)
Package Data Abstraction Coupling (PDAC)
Cohesion
Lack of Cohesion in Methods (LCOM)
Improvement of LCOM (ILCOM)
Tight Class Cohesion (TCC)

Design Guidelines and Code Conventions
Documentation
Lack Of Documentation (LOD)
Code Conventions

Lack Of Documentation Description. How many comments are lacking in a class, considering one class comment
and a comment per method as optimum. Structure and content of the comments are ignored.
http://www.arisa.se/compendium/node121.html
Tight Class Cohesion Description
The Tight Class Cohesion metric measures the cohesion between the public methods of a class. That is the
relative number of directly connected public methods in the class. Classes having a low cohesion indicate errors
in the design. http://www.arisa.se/compendium/node118.html
Thread4Friend.java

1
2
3
4
5
6

/**
*
* Thread4Friend controls apperance of friend's position on screen
*/
//import javax.microedition.lcdui.*;

clxxix

Zarko Acimovic

7 //import javax.microedition.midlet.*;
8
9 import java.util.*;
10 import java.io.*;
11
12
13 public class Thread4Friend implements Runnable{
14
Thread t;
15
Vector whiteList;
16
String resource;
17
MapObjects mob;
18
ImageCanvas3 ic;
19
MapBackground mb;
20
Outlook oul;
21
int hashID;
22
boolean first = false;
23
24
Thread4Friend(Vector whiteList, String resource, MapObjects mob,
ImageCanvas3 ic, MapBackground mb, Outlook oul){
25
this.oul = oul;
26
this.mob = mob;
27
this.mb = mb;
28
this.ic = ic;
29
this.resource = resource;
30
this.whiteList = whiteList;
31
t = new Thread(this);
32
//t.start();
33
hashID = t.hashCode();
34
}
35
36
public void start(){
37
38
t.start();
39
}
40
41
public int getID(){
42
return hashID;
43
}
44
45
public void run(){
46
47
Thread current = Thread.currentThread();
48
//System.out.println*
49
Integer friendID = new Integer(current.hashCode());
50
while(whiteList.contains(friendID)){
51
current = Thread.currentThread();
52
friendID = new Integer(current.hashCode());
53
String s = this.getResourceAsString(resource);
54
int nextIndex = 6;
55
int index = s.indexOf('\n');
56
clxxx

"". 62 int end = index.true).index+1).indexOf('\n'.nextComma). 66 String timeStamp = "".Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 57 nextIndex = s. 89 90 wp = null.'.setImage("blanco").indexOf('.indexOf('\n'. 72 Point wp = null. 68 69 while(index<lastIndex && whiteList.length()). 65 String c2 = "".equals("")){ 92 wp = new Point(c2.sleep(1000).currentThread(). 85 begin = index-1. 71 friendID = new Integer(current.hashCode()).temp. 83 timeStamp = temp."". 73 String temp = s. 75 if(temp. 94 } 95 } 96 try{ 97 Thread. 58 59 int lastIndex = s. 87 index = nextIndex. 91 if(!c1. 74 temp = compact(temp). 88 nextIndex = s. 80 c1 = temp.indexOf('.resource. 63 64 String c1 = "".substring(nextComma+1.parseLong(timeStamp). 81 int nextComma = temp.equals("")){ //na kraju ce temp da bude prazno 76 index = lastIndex+1.comma).comma+1).').substring(begin+2.substring(0. 67 long currentTS = 0. 98 }catch(Exception e){} clxxxi .contains(friendID)){ 70 current = Thread.c1.nextIndex+1).substring(comma+1. 93 wp. 79 int comma = temp. 60 61 int begin = -2. 77 } else { 78 temp = compact(temp).end).lastIndexOf('\n'). 84 currentTS = Long. 82 c2 = temp. 86 end = nextIndex.

i<d. 101 mob.println("Length of ret is "+ret.println("Bugger is: "+s). 138 String ret = "". 137 char[] d = s. 129 int kk = ret.length()). i++){ 140 int temp = (int)d[i]. 146 return ret.Zarko Acimovic 99 if(wp!=null && whiteList. 105 } 106 ic.updateFriend(friendID. 130 //if (kk!=k) System.println("Length of s is "+s.println("Length of ret is "+ret. 144 int kk = ret. 102 if(first==false) { 103 mb.length().println("Length of s is "+s. 104 first=true.length(). 126 if(temp>32) ret+=d[i]. 107 } 108 } 109 } 110 } 111 112 113 114 /** Blanco characters are possible to occur in names of pictures. 124 for(int i=0.length(). 132 } 133 134 public String compactFine(String s){ 135 int k = s. 115 * Integer representations of blanko characters are 9 and 32 116 * Also.out. 141 if(temp!=32 && temp!=9) ret+=d[i].toCharArray(). 127 } 128 //System.setDrawablePoints().toCharArray().length.length()). 123 String ret = "". 122 char[] d = s.out. so I excluded them too 118 */ 119 public String compact(String s){ 120 int k = s. 147 } 148 clxxxii .setBackground(wp).length. 121 //System.repaint(). 131 return ret.out.out. 136 //System.out.wp).length()).out.length()). 145 //if (kk!=k) System. 139 for(int i=0.length().println("Bugger is: "+s). 142 } 143 //System. characters with integer representation between 0 and 33 117 * can not be printed out in WSDD console. i<d. i++){ 125 int temp = (int)d[i].contains(friendID)){ 100 mob.

Example Java Project Tested by VizzMaintenance Metrics Eclipse Plugin 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 public String getResourceAsString(String resource){ InputStream is = null.close(). char m =' '. } } ABOUT THE AUTHOR clxxxiii .read().setCurrent(a). } public void setFirst(){ first = false. //d. }catch(Exception e) { //a. try{ m = (char)is. try{ is = this.read().setString("There is no such resource").getClass(). }catch(Exception e){} } try{ is. try{ m = (char)is. }catch(Exception e){} s=compactFine(s). }catch(Exception e){} while(m!=65535){ s+=m. return s. } //conversion of resource into string String s = "".getResourceAsStream(resource).

com/AutomatedTesting clxxxiv .facebook.Zarko Acimovic Follow me on https://www.