File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/main/java/de/tum/cit/aet Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11package de .tum .cit .aet .ai .dto ;
22
33import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
4+ import de .tum .cit .aet .analysis .util .DtoUtils ;
45
56/**
67 * Result of LLM-based effort rating for a commit chunk.
@@ -32,8 +33,7 @@ public record EffortRatingDTO(
3233 * Normalizes to roughly match raw effort score but considers quality.
3334 */
3435 public double weightedEffort () {
35- double qualityMultiplier = 0.5 + (0.3 * complexity / 10.0 ) + (0.2 * novelty / 10.0 );
36- return effortScore * qualityMultiplier ;
36+ return DtoUtils .calculateWeightedEffort (effortScore , complexity , novelty );
3737 }
3838
3939 /**
Original file line number Diff line number Diff line change @@ -19,4 +19,19 @@ private DtoUtils() {
1919 public static int calculateLinesChanged (int linesAdded , int linesDeleted ) {
2020 return linesAdded + linesDeleted ;
2121 }
22+
23+ /**
24+ * Calculates a weighted effort score.
25+ * Formula: effortScore * (0.5 + 0.3*complexity + 0.2*novelty) / 10
26+ * Normalizes to roughly match raw effort score but considers quality.
27+ *
28+ * @param effortScore raw effort score (1-10)
29+ * @param complexity technical complexity (1-10)
30+ * @param novelty originality of the work (1-10)
31+ * @return weighted effort score
32+ */
33+ public static double calculateWeightedEffort (double effortScore , double complexity , double novelty ) {
34+ double qualityMultiplier = 0.5 + (0.3 * complexity / 10.0 ) + (0.2 * novelty / 10.0 );
35+ return effortScore * qualityMultiplier ;
36+ }
2237}
You can’t perform that action at this time.
0 commit comments