-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathspring-petclinic-rest-report.html
983 lines (933 loc) · 44.3 KB
/
spring-petclinic-rest-report.html
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
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
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
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
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
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
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
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
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
433
434
435
436
437
438
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
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
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
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
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
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
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Refactor First Report for spring-petclinic-rest 3.4.3 </title>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-graphviz/3.0.5/d3-graphviz.min.js"></script>
<script src="https://unpkg.com/@hpcc-js/[email protected]/dist/index.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sigma.js/2.4.0/sigma.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/graphology/0.25.4/graphology.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/graphlib/2.1.8/graphlib.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/graphlib-dot.min.js"></script>
<script src="https://unpkg.com/3d-force-graph"></script>
</head> <body class="composite">
<div class="overlay" id="overlay" onclick="hidePopup()"></div><script>
function sugiyamaLayout(graph) {
var layers = [];
var nodeLevels = {};
var nodes = graph.nodes();
//var edges = graph.edges();
// Step 1: Assign levels to nodes
function assignLevels() {
var visited = {};
var stack = [];
function visit(node, level) {
if (visited[node]) return;
visited[node] = true;
nodeLevels[node] = level;
if (!layers[level]) layers[level] = [];
layers[level].push(node);
stack.push(node);
graph.forEachNeighbor(node, function (neighbor) {
visit(neighbor, level + 1);
});
}
nodes.forEach(function (node) {
if (!visited[node]) visit(node, 0);
});
}
// Step 2: Reduce edge crossings
function reduceCrossings() {
for (var i = 0; i < layers.length - 1; i++) {
var layer = layers[i];
var nextLayer = layers[i + 1];
var positions = {};
nextLayer.forEach(function (node, index) {
positions[node] = index;
});
layer.sort(function (a, b) {
var aPos = 0, bPos = 0;
graph.forEachNeighbor(a, function (neighbor) {
aPos += positions[neighbor] || 0;
});
graph.forEachNeighbor(b, function (neighbor) {
bPos += positions[neighbor] || 0;
});
return aPos - bPos;
});
}
}
// Step 3: Assign positions to nodes
function assignPositions() {
var yStep = 100;
var xStep = 2000;
layers.forEach(function (layer, level) {
var layerWidth = layer.length * xStep;
var offsetX = ((screen.width - 200) - layerWidth) / 2; // Centering the nodes
layer.forEach(function (node, index) {
graph.setNodeAttribute(node, 'x', offsetX + index * xStep);
graph.setNodeAttribute(node, 'y', -level * yStep);
});
});
}
assignLevels();
reduceCrossings();
assignPositions();
}
function renderGraph(dot) {
// Parse the DOT graph using graphlib-dot
const graphlibGraph = graphlibDot.read(dot);
// Convert graphlib graph to graphology graph
const graphologyGraph = new graphology.Graph();
graphlibGraph.nodes().forEach(node => {
const attrs = graphlibGraph.node(node);
graphologyGraph.addNode(node, {
label: node,
color: attrs.color,
// x: Math.random(),
// y: Math.random(),
size: 5,
});
});
graphlibGraph.edges().forEach(edge => {
const attrs = graphlibGraph.edge(edge);
graphologyGraph.addEdge(edge.v, edge.w, {
color: attrs.color,
size: 1,
type: 'arrow',
});
});
sugiyamaLayout(graphologyGraph)
return graphologyGraph;
}
</script><script type="module">
// SpriteText will only work as import
// this script block requires type=module since we are using an import
import SpriteText from "https://esm.sh/three-spritetext";
function createForceGraph(popupId, containerName, dot) {
// Add event listener for Escape key to close the popup
document.addEventListener('keydown', function (event) {
if (event.key === 'Escape') {
hidePopup();
}
});
document.getElementById('overlay').style.display = 'block';
document.getElementById(popupId).style.display = 'block';
var container = document.getElementById(containerName);
// Parse the DOT graph using graphlib-dot
const graphlibGraph = graphlibDot.read(dot);
var nodes = [];
var links = [];
graphlibGraph.nodes().forEach(function (node) {
var nodeData = graphlibGraph.node(node);
nodes.push({
id: node,
color: nodeData.color || 'white',
});
});
graphlibGraph.edges().forEach(function (edge) {
links.push({
source: edge.v,
target: edge.w,
color: graphlibGraph.edge(edge).color || 'white',
weight: graphlibGraph.edge(edge).weight,
});
});
const gData = {
nodes: nodes,
links: links
};
// cross-link node objects
gData.links.forEach(link => {
const a = gData.nodes.find(node => node.id === link.source);
const b = gData.nodes.find(node => node.id === link.target);
!a.neighbors && (a.neighbors = []);
!b.neighbors && (b.neighbors = []);
a.neighbors.push(b);
b.neighbors.push(a);
!a.links && (a.links = []);
!b.links && (b.links = []);
a.links.push(link);
b.links.push(link);
});
const Graph = new ForceGraph3D(container)
.graphData(gData)
.nodeLabel('id')
.width(container.clientWidth)
.height(container.clientHeight);
if(gData.links.length + gData.nodes.length < 4000) {
console.log(gData.links.length + gData.nodes.length);
// use node labels instead of spheres
Graph.nodeThreeObject(node => {
const sprite = new SpriteText(node.id);
sprite.material.depthWrite = false; // make sprite background transparent
sprite.color = node.color;
sprite.textHeight = 4;
return sprite;
});
// code to display weight as link text
// may be too much for browsers to handle
// Graph
// .linkThreeObjectExtend(true)
// .linkThreeObject(link => {
// // extend link with text sprite
// const sprite = new SpriteText(`${link.weight}`);
// sprite.color = 'lightgrey';
// sprite.textHeight = 3;
// return sprite;
// })
// .linkPositionUpdate((sprite, {start, end}) => {
// const middlePos = Object.assign(...['x', 'y', 'z'].map(c => ({
// [c]: start[c] + (end[c] - start[c]) / 2 // calc middle point
// })));
//
// // Position sprite
// Object.assign(sprite.position, middlePos);
// });
// code to highlight nodes & links
// TODO: enable via control - see Manipulate Link Force Distance for example
const highlightNodes = new Set();
const highlightLinks = new Set();
let hoverNode = null;
Graph
.nodeColor(node => highlightNodes.has(node) ? node === hoverNode ? 'rgb(255,0,0,1)' : 'rgba(255,160,0,0.8)' : 'rgba(0,255,255,0.6)')
.linkWidth(link => highlightLinks.has(link) ? 4 : 1)
.linkDirectionalParticles(link => highlightLinks.has(link) ? 4 : 0)
.linkDirectionalParticleWidth(4)
.onNodeHover(node => {
// no state change
if ((!node && !highlightNodes.size) || (node && hoverNode === node)) return;
highlightNodes.clear();
highlightLinks.clear();
if (node) {
highlightNodes.add(node);
node.neighbors.forEach(neighbor => highlightNodes.add(neighbor));
node.links.forEach(link => highlightLinks.add(link));
}
hoverNode = node || null;
updateHighlight(Graph);
})
.onLinkHover(link => {
highlightNodes.clear();
highlightLinks.clear();
if (link) {
highlightLinks.add(link);
highlightNodes.add(link.source);
highlightNodes.add(link.target);
}
updateHighlight(Graph);
});
}
}
// used by highlighting functionality
function updateHighlight(Graph) {
// trigger update of highlighted objects in scene
Graph
.nodeColor(Graph.nodeColor())
.linkWidth(Graph.linkWidth())
.linkDirectionalParticles(Graph.linkDirectionalParticles());
}
// needed to allow the button to open the graph
window.createForceGraph = createForceGraph; </script><script>
function showPopup(popupId, containerName, dot) {
// Add event listener for Escape key to close the popup
document.addEventListener('keydown', function (event) {
if (event.key === 'Escape') {
hidePopup();
}
}); document.getElementById('overlay').style.display = 'block';
document.getElementById(popupId).style.display = 'block';
var graph = renderGraph(dot);
var container = document.getElementById(containerName);
// Render with Sigma.js
new Sigma(graph, container);
}
function hidePopup() {
document.getElementById('overlay').style.display = 'none';
var popups = document.getElementsByClassName('popup');
for (var i = 0; i < popups.length; i++) {
popups[i].style.display = 'none';
}
// Clear the graph containers to remove the previous graphs
var containers = document.querySelectorAll('[id^="graph-container"]');
containers.forEach(function(container) {
while (container.firstChild) {
container.removeChild(container.firstChild);
}
});
// Remove the Escape key event listener
document.removeEventListener('keydown', function (event) {
if (event.key === 'Escape') {
hidePopup();
}
}); }
</script><style>
/* Popup container */
.popup {
position: fixed;
display: none;
width: 95%;
height: 95%;
background-color: white;
border: 1px solid #ccc;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1000;
padding: 20px;
box-sizing: border-box;
}
/* Popup overlay */
.overlay {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
}
/* Close button */
.close-btn {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
</style> <div id="banner">
</div>
<div id="breadcrumbs">
<div class="xleft">
</div>
<div class="xright"> </div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<section>
<h2><a href="https://github.com/refactorfirst/refactorfirst" target="_blank" title="Learn about RefactorFirst" aria-label="RefactorFirst">RefactorFirst</a> Report for spring-petclinic-rest 3.4.3</h2>
<a href="#EDGES">Back Edges</a>
<br/>
<a href="#CBO">Highly Coupled Classes</a>
<br/>
<a href="#CYCLES">Class Cycles</a>
<h1 align="center">Class Map</h1><div align="center">Excludes classes that have no incoming and outgoing edges<br></div><script>
const classGraph_dot = `strict digraph G {
OwnerMapper -> Owner [ label = "5" weight = "5" ];
PetMapper -> Pet [ label = "5" weight = "5" ];
PetMapper -> PetType [ label = "3" weight = "3" ];
PetTypeMapper -> PetType [ label = "5" weight = "5" ];
SpecialtyMapper -> Specialty [ label = "4" weight = "4" ];
UserMapper -> Role [ label = "4" weight = "4" ];
UserMapper -> User [ label = "2" weight = "2" ];
VetMapper -> Vet [ label = "4" weight = "4" ];
VisitMapper -> Visit [ label = "4" weight = "4" ];
NamedEntity -> BaseEntity [ label = "1" weight = "1" ];
Owner -> Person [ label = "1" weight = "1" ];
Owner -> Pet [ label = "13" weight = "13" color = "red" ];
Owner -> NamedEntity [ label = "1" weight = "1" ];
Person -> BaseEntity [ label = "1" weight = "1" ];
Pet -> NamedEntity [ label = "1" weight = "1" ];
Pet -> Visit [ label = "9" weight = "9" ];
Pet -> PetType [ label = "3" weight = "3" ];
Pet -> Owner [ label = "3" weight = "3" ];
PetType -> NamedEntity [ label = "1" weight = "1" ];
Role -> BaseEntity [ label = "1" weight = "1" ];
Role -> User [ label = "3" weight = "3" color = "red" ];
Specialty -> NamedEntity [ label = "1" weight = "1" ];
User -> Role [ label = "6" weight = "6" ];
Vet -> Person [ label = "1" weight = "1" ];
Vet -> Specialty [ label = "8" weight = "8" ];
Visit -> BaseEntity [ label = "1" weight = "1" ];
Visit -> Pet [ label = "3" weight = "3" color = "red" ];
JdbcOwnerRepositoryImpl -> OwnerRepository [ label = "1" weight = "1" ];
JdbcOwnerRepositoryImpl -> Owner [ label = "13" weight = "13" ];
JdbcOwnerRepositoryImpl -> JdbcPet [ label = "2" weight = "2" ];
JdbcOwnerRepositoryImpl -> PetType [ label = "2" weight = "2" ];
JdbcOwnerRepositoryImpl -> Pet [ label = "3" weight = "3" ];
JdbcOwnerRepositoryImpl -> Visit [ label = "2" weight = "2" ];
JdbcPet -> Pet [ label = "1" weight = "1" ];
JdbcPetRepositoryImpl -> PetRepository [ label = "1" weight = "1" ];
JdbcPetRepositoryImpl -> EntityUtils [ label = "1" weight = "1" ];
JdbcPetRepositoryImpl -> OwnerRepository [ label = "3" weight = "3" ];
JdbcPetRepositoryImpl -> VisitRepository [ label = "2" weight = "2" ];
JdbcPetRepositoryImpl -> Owner [ label = "2" weight = "2" ];
JdbcPetRepositoryImpl -> Pet [ label = "8" weight = "8" ];
JdbcPetRepositoryImpl -> JdbcPet [ label = "3" weight = "3" ];
JdbcPetRepositoryImpl -> PetType [ label = "2" weight = "2" ];
JdbcPetRepositoryImpl -> Visit [ label = "2" weight = "2" ];
JdbcPetRowMapper -> BaseEntity [ label = "1" weight = "1" ];
JdbcPetRowMapper -> NamedEntity [ label = "1" weight = "1" ];
JdbcPetRowMapper -> Pet [ label = "1" weight = "1" ];
JdbcPetRowMapper -> JdbcPet [ label = "5" weight = "5" ];
JdbcPetTypeRepositoryImpl -> PetTypeRepository [ label = "1" weight = "1" ];
JdbcPetTypeRepositoryImpl -> PetType [ label = "7" weight = "7" ];
JdbcPetTypeRepositoryImpl -> Pet [ label = "3" weight = "3" ];
JdbcPetTypeRepositoryImpl -> Visit [ label = "3" weight = "3" ];
JdbcPetVisitExtractor -> Pet [ label = "1" weight = "1" ];
JdbcPetVisitExtractor -> JdbcPet [ label = "1" weight = "1" ];
JdbcPetVisitExtractor -> Visit [ label = "1" weight = "1" ];
JdbcSpecialtyRepositoryImpl -> SpecialtyRepository [ label = "1" weight = "1" ];
JdbcSpecialtyRepositoryImpl -> Specialty [ label = "7" weight = "7" ];
JdbcUserRepositoryImpl -> UserRepository [ label = "1" weight = "1" ];
JdbcUserRepositoryImpl -> User [ label = "3" weight = "3" ];
JdbcUserRepositoryImpl -> Role [ label = "1" weight = "1" ];
JdbcVetRepositoryImpl -> VetRepository [ label = "1" weight = "1" ];
JdbcVetRepositoryImpl -> Vet [ label = "9" weight = "9" ];
JdbcVetRepositoryImpl -> Specialty [ label = "5" weight = "5" ];
JdbcVetRepositoryImpl -> EntityUtils [ label = "2" weight = "2" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> BaseEntity [ label = "1" weight = "1" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> Visit [ label = "6" weight = "6" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> Pet [ label = "2" weight = "2" ];
JdbcVisitRepositoryImpl -> VisitRepository [ label = "1" weight = "1" ];
JdbcVisitRepositoryImpl -> Visit [ label = "9" weight = "9" ];
JdbcVisitRepositoryImpl -> JdbcPet [ label = "1" weight = "1" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> JdbcPet [ label = "2" weight = "2" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> PetType [ label = "2" weight = "2" ];
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt -> Owner [ label = "2" weight = "2" ];
JdbcVisitRowMapper -> BaseEntity [ label = "1" weight = "1" ];
JdbcVisitRowMapper -> Visit [ label = "5" weight = "5" ];
JpaOwnerRepositoryImpl -> OwnerRepository [ label = "1" weight = "1" ];
JpaOwnerRepositoryImpl -> Owner [ label = "5" weight = "5" ];
JpaPetRepositoryImpl -> PetRepository [ label = "1" weight = "1" ];
JpaPetRepositoryImpl -> Pet [ label = "4" weight = "4" ];
JpaPetRepositoryImpl -> PetType [ label = "1" weight = "1" ];
JpaPetTypeRepositoryImpl -> PetTypeRepository [ label = "1" weight = "1" ];
JpaPetTypeRepositoryImpl -> PetType [ label = "5" weight = "5" ];
JpaPetTypeRepositoryImpl -> BaseEntity [ label = "1" weight = "1" ];
JpaPetTypeRepositoryImpl -> Pet [ label = "3" weight = "3" ];
JpaPetTypeRepositoryImpl -> Visit [ label = "2" weight = "2" ];
JpaSpecialtyRepositoryImpl -> SpecialtyRepository [ label = "1" weight = "1" ];
JpaSpecialtyRepositoryImpl -> Specialty [ label = "5" weight = "5" ];
JpaSpecialtyRepositoryImpl -> BaseEntity [ label = "1" weight = "1" ];
JpaUserRepositoryImpl -> UserRepository [ label = "1" weight = "1" ];
JpaUserRepositoryImpl -> User [ label = "1" weight = "1" ];
JpaVetRepositoryImpl -> VetRepository [ label = "1" weight = "1" ];
JpaVetRepositoryImpl -> Vet [ label = "4" weight = "4" ];
JpaVisitRepositoryImpl -> VisitRepository [ label = "1" weight = "1" ];
JpaVisitRepositoryImpl -> Visit [ label = "5" weight = "5" ];
OwnerRepository -> Owner [ label = "5" weight = "5" ];
PetRepository -> Pet [ label = "4" weight = "4" ];
PetRepository -> PetType [ label = "1" weight = "1" ];
PetTypeRepository -> PetType [ label = "5" weight = "5" ];
SpecialtyRepository -> Specialty [ label = "5" weight = "5" ];
PetRepositoryOverride -> Pet [ label = "1" weight = "1" ];
PetTypeRepositoryOverride -> PetType [ label = "1" weight = "1" ];
SpecialtyRepositoryOverride -> Specialty [ label = "1" weight = "1" ];
SpringDataOwnerRepository -> OwnerRepository [ label = "1" weight = "1" ];
SpringDataOwnerRepository -> Owner [ label = "2" weight = "2" ];
SpringDataPetRepository -> PetRepository [ label = "1" weight = "1" ];
SpringDataPetRepository -> PetRepositoryOverride [ label = "1" weight = "1" ];
SpringDataPetRepository -> PetType [ label = "1" weight = "1" ];
SpringDataPetRepositoryImpl -> PetRepositoryOverride [ label = "1" weight = "1" ];
SpringDataPetRepositoryImpl -> Pet [ label = "1" weight = "1" ];
SpringDataPetTypeRepository -> PetTypeRepository [ label = "1" weight = "1" ];
SpringDataPetTypeRepository -> PetTypeRepositoryOverride [ label = "1" weight = "1" ];
SpringDataPetTypeRepositoryImpl -> PetTypeRepositoryOverride [ label = "1" weight = "1" ];
SpringDataPetTypeRepositoryImpl -> PetType [ label = "1" weight = "1" ];
SpringDataPetTypeRepositoryImpl -> BaseEntity [ label = "1" weight = "1" ];
SpringDataPetTypeRepositoryImpl -> Pet [ label = "3" weight = "3" ];
SpringDataPetTypeRepositoryImpl -> Visit [ label = "2" weight = "2" ];
SpringDataSpecialtyRepository -> SpecialtyRepository [ label = "1" weight = "1" ];
SpringDataSpecialtyRepository -> SpecialtyRepositoryOverride [ label = "1" weight = "1" ];
SpringDataSpecialtyRepositoryImpl -> SpecialtyRepositoryOverride [ label = "1" weight = "1" ];
SpringDataSpecialtyRepositoryImpl -> Specialty [ label = "1" weight = "1" ];
SpringDataSpecialtyRepositoryImpl -> BaseEntity [ label = "1" weight = "1" ];
SpringDataUserRepository -> UserRepository [ label = "1" weight = "1" ];
SpringDataVetRepository -> VetRepository [ label = "1" weight = "1" ];
SpringDataVisitRepository -> VisitRepository [ label = "1" weight = "1" ];
SpringDataVisitRepository -> VisitRepositoryOverride [ label = "1" weight = "1" ];
SpringDataVisitRepositoryImpl -> VisitRepositoryOverride [ label = "1" weight = "1" ];
SpringDataVisitRepositoryImpl -> Visit [ label = "1" weight = "1" ];
VisitRepositoryOverride -> Visit [ label = "1" weight = "1" ];
UserRepository -> User [ label = "1" weight = "1" ];
VetRepository -> Vet [ label = "4" weight = "4" ];
VisitRepository -> Visit [ label = "5" weight = "5" ];
ExceptionControllerAdvice -> BindingErrorsResponse [ label = "2" weight = "2" ];
BindingErrorsResponse -> BindingErrorsResponse_BindingError [ label = "11" weight = "11" ];
OwnerRestController -> ClinicService [ label = "11" weight = "11" ];
OwnerRestController -> Owner [ label = "12" weight = "12" ];
OwnerRestController -> Person [ label = "2" weight = "2" ];
OwnerRestController -> BaseEntity [ label = "2" weight = "2" ];
OwnerRestController -> Pet [ label = "5" weight = "5" ];
OwnerRestController -> NamedEntity [ label = "1" weight = "1" ];
OwnerRestController -> Visit [ label = "2" weight = "2" ];
OwnerRestController -> OwnerMapper [ label = "4" weight = "4" ];
OwnerRestController -> PetMapper [ label = "4" weight = "4" ];
OwnerRestController -> VisitMapper [ label = "4" weight = "4" ];
PetRestController -> Pet [ label = "5" weight = "5" ];
PetRestController -> NamedEntity [ label = "1" weight = "1" ];
PetRestController -> ClinicService [ label = "7" weight = "7" ];
PetRestController -> PetMapper [ label = "4" weight = "4" ];
PetTypeRestController -> ClinicService [ label = "8" weight = "8" ];
PetTypeRestController -> NamedEntity [ label = "1" weight = "1" ];
PetTypeRestController -> PetTypeMapper [ label = "3" weight = "3" ];
PetTypeRestController -> PetType [ label = "6" weight = "6" ];
SpecialtyRestController -> ClinicService [ label = "8" weight = "8" ];
SpecialtyRestController -> NamedEntity [ label = "1" weight = "1" ];
SpecialtyRestController -> SpecialtyMapper [ label = "3" weight = "3" ];
SpecialtyRestController -> Specialty [ label = "4" weight = "4" ];
UserRestController -> UserService [ label = "3" weight = "3" ];
UserRestController -> UserMapper [ label = "3" weight = "3" ];
UserRestController -> User [ label = "1" weight = "1" ];
VetRestController -> ClinicService [ label = "10" weight = "10" ];
VetRestController -> Person [ label = "2" weight = "2" ];
VetRestController -> Vet [ label = "5" weight = "5" ];
VetRestController -> VetMapper [ label = "3" weight = "3" ];
VetRestController -> SpecialtyMapper [ label = "2" weight = "2" ];
VetRestController -> Specialty [ label = "3" weight = "3" ];
VisitRestController -> ClinicService [ label = "8" weight = "8" ];
VisitRestController -> Visit [ label = "8" weight = "8" ];
VisitRestController -> VisitMapper [ label = "3" weight = "3" ];
ClinicService -> Pet [ label = "4" weight = "4" ];
ClinicService -> Visit [ label = "5" weight = "5" ];
ClinicService -> Vet [ label = "5" weight = "5" ];
ClinicService -> Owner [ label = "5" weight = "5" ];
ClinicService -> PetType [ label = "5" weight = "5" ];
ClinicService -> Specialty [ label = "5" weight = "5" ];
ClinicServiceImpl -> ClinicService [ label = "1" weight = "1" ];
ClinicServiceImpl -> PetRepository [ label = "6" weight = "6" ];
ClinicServiceImpl -> VisitRepository [ label = "6" weight = "6" ];
ClinicServiceImpl -> VetRepository [ label = "6" weight = "6" ];
ClinicServiceImpl -> OwnerRepository [ label = "6" weight = "6" ];
ClinicServiceImpl -> PetTypeRepository [ label = "5" weight = "5" ];
ClinicServiceImpl -> SpecialtyRepository [ label = "5" weight = "5" ];
ClinicServiceImpl -> Pet [ label = "5" weight = "5" ];
ClinicServiceImpl -> Visit [ label = "5" weight = "5" ];
ClinicServiceImpl -> Vet [ label = "5" weight = "5" ];
ClinicServiceImpl -> Owner [ label = "5" weight = "5" ];
ClinicServiceImpl -> PetType [ label = "5" weight = "5" ];
ClinicServiceImpl -> Specialty [ label = "5" weight = "5" ];
UserService -> User [ label = "1" weight = "1" ];
UserServiceImpl -> UserService [ label = "1" weight = "1" ];
UserServiceImpl -> UserRepository [ label = "2" weight = "2" ];
UserServiceImpl -> User [ label = "1" weight = "1" ];
UserServiceImpl -> Role [ label = "1" weight = "1" ];
BaseEntity -> EntityUtils [ label = "4" weight = "4" ];
EntityUtils -> BaseEntity [ label = "1" weight = "1" color = "red" ];
UserRepository;
SpecialtyMapper;
SpringDataPetRepositoryImpl;
JdbcPetVisitExtractor;
SpringDataOwnerRepository;
JdbcPetRowMapper;
PetTypeRepositoryOverride;
ExceptionControllerAdvice;
UserServiceImpl;
JdbcUserRepositoryImpl;
VetRestController;
Vet;
SpringDataVetRepository;
JdbcVetRepositoryImpl;
JpaVetRepositoryImpl;
NamedEntity;
JdbcOwnerRepositoryImpl;
Owner;
Pet;
JdbcPetTypeRepositoryImpl;
PetRestController;
PetRepository;
JdbcSpecialtyRepositoryImpl;
JpaPetRepositoryImpl;
Specialty;
VisitRepository;
JdbcVisitRepositoryImpl;
SpecialtyRepositoryOverride;
SpringDataPetTypeRepositoryImpl;
JdbcPetRepositoryImpl;
SpringDataSpecialtyRepositoryImpl;
User;
ClinicServiceImpl;
Visit;
JpaPetTypeRepositoryImpl;
SpringDataPetRepository;
JpaUserRepositoryImpl;
UserRestController;
SpecialtyRestController;
SpringDataPetTypeRepository;
PetTypeMapper;
PetMapper;
BindingErrorsResponse;
EntityUtils;
PetTypeRepository;
SpringDataSpecialtyRepository;
VisitMapper;
Role;
JdbcPet;
VetRepository;
BindingErrorsResponse_BindingError;
PetType;
OwnerRepository;
JpaSpecialtyRepositoryImpl;
OwnerRestController;
VisitRepositoryOverride;
ClinicService;
UserService;
PetTypeRestController;
SpringDataVisitRepository;
BaseEntity;
OwnerMapper;
VetMapper;
SpringDataVisitRepositoryImpl;
JdbcVisitRepositoryImpl_JdbcVisitRowMapperExt;
JpaVisitRepositoryImpl;
VisitRestController;
JdbcVisitRowMapper;
Person;
SpecialtyRepository;
JpaOwnerRepositoryImpl;
PetRepositoryOverride;
SpringDataUserRepository;
UserMapper;
}`;
</script>
<button style="display: block; margin: 0 auto;" onclick="createForceGraph('popup-classGraph', 'graph-container-classGraph', classGraph_dot )">Show classGraph 3D Popup</button>
<button style="display: block; margin: 0 auto;" onclick="showPopup('popup-classGraph', 'graph-container-classGraph', classGraph_dot )">Show classGraph 2D Popup</button>
<div class="popup" id="popup-classGraph">
<span class="close-btn" onclick="hidePopup()">×</span>
<div id="graph-container-classGraph" style="width: 100%; height: 100%;"></div>
</div>
<div align="center">
Red lines represent back edges to remove.<br>
Zoom in / out with your mouse wheel and click/move to drag the image.
</div>
<div align="center" id="classGraph" style="border: thin solid black"></div>
<script>
d3.select("#classGraph")
.graphviz()
.width(screen.width - 200)
.height(screen.height)
.fit(true)
.renderDot(classGraph_dot);
</script>
<br/>
<div align="center">
Show RefactorFirst some ❤️
<br/>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star refactorfirst/refactorfirst on GitHub">Star</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork refactorfirst/refactorfirst on GitHub">Fork</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch refactorfirst/refactorfirst on GitHub">Watch</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/issues" data-icon="octicon-issue-opened" data-size="large" data-show-count="false" aria-label="Issue refactorfirst/refactorfirst on GitHub">Issue</a>
<a class="github-button" href="https://github.com/sponsors/jimbethancourt" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @jimbethancourt on GitHub">Sponsor</a>
</div><br/>
<div style="text-align: center;"><a id="EDGES"><h1>Backward Edge Removal Impact</h1></a></div>
<div style="text-align: center;">
Current Cycle Count: 3<br>
Current Average Cycle Node Count: 2.3333333333333335<br>
Current Total Back Edge Count: 4<br>
Current Total Min Weight Back Edge Count: 1<br>
</div>
<table align="center" border="5px">
<thead>
<tr>
<th>Edge</th>
<th>Edge Weight</th>
<th>In # of Cycles</th>
<th>New Cycle Count</th>
<th>New Avg Cycle Node Count</th>
<th>Avg Node Δ ÷ Effort</th>
</thead>
<tbody>
<tr>
<td align="left">Visit → Pet : 3</td>
<td align="right">3</td>
<td align="right">1</td>
<td align="right">3</td>
<td align="right">2.0</td>
<td align="right">0.11111111111111116</td>
</tr>
<tr>
<td align="left">Owner → Pet : 13</td>
<td align="right">13</td>
<td align="right">1</td>
<td align="right">3</td>
<td align="right">2.0</td>
<td align="right">0.025641025641025654</td>
</tr>
<tr>
<td align="left">Role → User : 3</td>
<td align="right">3</td>
<td align="right">1</td>
<td align="right">2</td>
<td align="right">2.5</td>
<td align="right">-0.055555555555555504</td>
</tr>
<tr>
<td align="left">EntityUtils → BaseEntity : 1</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">2</td>
<td align="right">2.5</td>
<td align="right">-0.16666666666666652</td>
</tr>
</tbody>
</table>
<div align="center">
Show RefactorFirst some ❤️
<br/>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star refactorfirst/refactorfirst on GitHub">Star</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork refactorfirst/refactorfirst on GitHub">Fork</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch refactorfirst/refactorfirst on GitHub">Watch</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/issues" data-icon="octicon-issue-opened" data-size="large" data-show-count="false" aria-label="Issue refactorfirst/refactorfirst on GitHub">Issue</a>
<a class="github-button" href="https://github.com/sponsors/jimbethancourt" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @jimbethancourt on GitHub">Sponsor</a>
</div><br/>
<br/>
<br/>
<br/>
<hr/>
<br/>
<br/>
<div style="text-align: center;"><a id="CBO"><h1>Highly Coupled Classes</h1></a></div><div id="series_chart_div_2" align="center"><script> google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawSeriesChart);
function drawSeriesChart() {
var data2 = google.visualization.arrayToDataTable([[ 'ID', 'Coupling Count', 'Change Proneness', 'Priority', 'Priority (Visual)'], ['ClinicServiceImpl.java',22,1,1,-1]]);
var options = {
title: 'Priority Ranking for Refactoring Highly Coupled Classes - ' +
'Start with Priority 1',
height: 900, width: 1200, explorer: {}, hAxis: {title: 'Coupling Count'},
vAxis: {title: 'Change Proneness'},
colorAxis: {colors: ['green', 'red']},
bubble: {textStyle: {fontSize: 11}} };
var chart2 = new google.visualization.BubbleChart(document.getElementById('series_chart_div_2'));
chart2.draw(data2, options);
}
</script></div>
<div align="center">
Show RefactorFirst some ❤️
<br/>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star refactorfirst/refactorfirst on GitHub">Star</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork refactorfirst/refactorfirst on GitHub">Fork</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch refactorfirst/refactorfirst on GitHub">Watch</a>
<a class="github-button" href="https://github.com/refactorfirst/refactorfirst/issues" data-icon="octicon-issue-opened" data-size="large" data-show-count="false" aria-label="Issue refactorfirst/refactorfirst on GitHub">Issue</a>
<a class="github-button" href="https://github.com/sponsors/jimbethancourt" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @jimbethancourt on GitHub">Sponsor</a>
</div> <h2>Coupling Between Objects Chart Legend:</h2> <table border="5px">
<tbody>
<tr><td><strong>X-Axis:</strong> Number of objects the class is coupled to</td></tr>
<tr><td><strong>Y-Axis:</strong> Relative churn</td></tr>
<tr><td><strong>Color:</strong> Priority of what to fix first</td></tr>
<tr><td><strong>Circle size:</strong> Priority (Visual) of what to fix first</td></tr>
</tbody>
</table> <br/><h2 align="center">Highly Coupled classes by the numbers: (Refactor starting with Priority 1)</h2><table align="center" border="5px"><thead><tr><th>Class</th><th>Priority</th><th>Change Proneness Rank</th><th>Coupling Count</th><th>Most Recent Commit Date</th><th>Commit Count</th></tr></thead><tbody><tr><td align="left">ClinicServiceImpl.java</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">22</td>
<td align="right">12/28/24, 11:16 AM</td>
<td align="right">23</td>
</tr></tbody></table><br/>
<br/>
<br/>
<br/>
<hr/>
<br/>
<br/>
<div style="text-align: center;"><a id="CYCLES"><h1>Class Cycles</h1></a></div>
<h2 align="center">Class Cycles by the numbers:</h2>
<table align="center" border="5px">
<thead>
<tr>
<th>Cycle Name</th>
<th>Priority</th>
<th>Class Count</th>
<th>Relationship Count</th>
</thead>
<tbody>
<tr>
<td align="left">Pet</td>
<td align="right">1</td>
<td align="right">3</td>
<td align="right">4</td>
</tr>
<tr>
<td align="left">Role</td>
<td align="right">2</td>
<td align="right">2</td>
<td align="right">2</td>
</tr>
<tr>
<td align="left">BaseEntity</td>
<td align="right">3</td>
<td align="right">2</td>
<td align="right">2</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<br/>
<hr/>
<br/>
<br/>
<h2 align="center">Class Cycle : Pet</h2>
<script>
const Pet_dot = `strict digraph G {
Pet;
Owner;
Visit;
Owner -> Pet [ label = "13" weight = "13" color = "red" ];
Pet -> Visit [ label = "9" weight = "9" ];
Pet -> Owner [ label = "3" weight = "3" ];
Visit -> Pet [ label = "3" weight = "3" color = "red" ];
}`;
</script>
<button style="display: block; margin: 0 auto;" onclick="createForceGraph('popup-Pet', 'graph-container-Pet', Pet_dot )">Show Pet 3D Popup</button>
<button style="display: block; margin: 0 auto;" onclick="showPopup('popup-Pet', 'graph-container-Pet', Pet_dot )">Show Pet 2D Popup</button>
<div class="popup" id="popup-Pet">
<span class="close-btn" onclick="hidePopup()">×</span>
<div id="graph-container-Pet" style="width: 100%; height: 100%;"></div>
</div>
<div align="center">
Red lines represent back edges to remove.<br>
Zoom in / out with your mouse wheel and click/move to drag the image.
</div>
<div align="center" id="Pet" style="border: thin solid black"></div>
<script>
d3.select("#Pet")
.graphviz()
.width(screen.width - 200)
.height(screen.height)
.fit(true)
.renderDot(Pet_dot);
</script>
<br/>
<br/>
<div align="center"><strong>Bold text indicates back edge to remove to decompose cycle</strong></div>
<table align="center" border="5px">
<thead>
<tr>
<th>Classes</th>
<th>Relationships</th>
</thead>
<tbody>
<tr><td align="left">Pet</td>
<td align="left">Pet → Visit : 9<br/>
Pet → Owner : 3<br/>
</td>
</tr>
<tr><td align="left">Owner</td>
<td align="left"><strong>Owner → Pet : 13</strong><br/>
</td>
</tr>
<tr><td align="left">Visit</td>
<td align="left"><strong>Visit → Pet : 3</strong><br/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<hr/>
<br/>
<br/>
<h2 align="center">Class Cycle : Role</h2>
<script>
const Role_dot = `strict digraph G {
Role;
User;
Role -> User [ label = "3" weight = "3" color = "red" ];
User -> Role [ label = "6" weight = "6" ];
}`;
</script>
<button style="display: block; margin: 0 auto;" onclick="createForceGraph('popup-Role', 'graph-container-Role', Role_dot )">Show Role 3D Popup</button>
<button style="display: block; margin: 0 auto;" onclick="showPopup('popup-Role', 'graph-container-Role', Role_dot )">Show Role 2D Popup</button>
<div class="popup" id="popup-Role">
<span class="close-btn" onclick="hidePopup()">×</span>
<div id="graph-container-Role" style="width: 100%; height: 100%;"></div>
</div>
<div align="center">
Red lines represent back edges to remove.<br>
Zoom in / out with your mouse wheel and click/move to drag the image.
</div>
<div align="center" id="Role" style="border: thin solid black"></div>
<script>
d3.select("#Role")
.graphviz()
.width(screen.width - 200)
.height(screen.height)
.fit(true)
.renderDot(Role_dot);
</script>
<br/>
<br/>
<div align="center"><strong>Bold text indicates back edge to remove to decompose cycle</strong></div>
<table align="center" border="5px">
<thead>
<tr>
<th>Classes</th>
<th>Relationships</th>
</thead>
<tbody>
<tr><td align="left">Role</td>
<td align="left"><strong>Role → User : 3</strong><br/>
</td>
</tr>
<tr><td align="left">User</td>
<td align="left">User → Role : 6<br/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<hr/>
<br/>
<br/>
<h2 align="center">Class Cycle : BaseEntity</h2>
<script>
const BaseEntity_dot = `strict digraph G {
BaseEntity;
EntityUtils;
BaseEntity -> EntityUtils [ label = "4" weight = "4" ];
EntityUtils -> BaseEntity [ label = "1" weight = "1" color = "red" ];
}`;
</script>
<button style="display: block; margin: 0 auto;" onclick="createForceGraph('popup-BaseEntity', 'graph-container-BaseEntity', BaseEntity_dot )">Show BaseEntity 3D Popup</button>
<button style="display: block; margin: 0 auto;" onclick="showPopup('popup-BaseEntity', 'graph-container-BaseEntity', BaseEntity_dot )">Show BaseEntity 2D Popup</button>
<div class="popup" id="popup-BaseEntity">
<span class="close-btn" onclick="hidePopup()">×</span>
<div id="graph-container-BaseEntity" style="width: 100%; height: 100%;"></div>
</div>
<div align="center">
Red lines represent back edges to remove.<br>
Zoom in / out with your mouse wheel and click/move to drag the image.
</div>
<div align="center" id="BaseEntity" style="border: thin solid black"></div>
<script>
d3.select("#BaseEntity")
.graphviz()
.width(screen.width - 200)
.height(screen.height)
.fit(true)
.renderDot(BaseEntity_dot);
</script>
<br/>
<br/>
<div align="center"><strong>Bold text indicates back edge to remove to decompose cycle</strong></div>
<table align="center" border="5px">
<thead>
<tr>
<th>Classes</th>
<th>Relationships</th>
</thead>
<tbody>
<tr><td align="left">BaseEntity</td>
<td align="left">BaseEntity → EntityUtils : 4<br/>
</td>
</tr>
<tr><td align="left">EntityUtils</td>
<td align="left"><strong>EntityUtils → BaseEntity : 1</strong><br/>
</td>
</tr>
</tbody>
</table>
</section>
<div class="clear">
<hr/>
</div>
<span id="publishDate">Last Published: 3/16/25, 8:52 PM <div class="clear">
<hr/>
</div>
</span></div>
</div>
</body>
</html>