Code Duplication    Length = 10-10 lines in 2 locations

src/pytest_benchmark/stats.py 2 locations

@@ 132-141 (lines=10) @@
129
        data = self.sorted_data
130
131
        # See: https://en.wikipedia.org/wiki/Quartile#Computing_methods
132
        if rounds == 1:
133
            return data[0]
134
        elif rounds % 2:  # Method 3
135
            n, q = rounds // 4, rounds % 4
136
            if q == 1:
137
                return 0.75 * data[3 * n] + 0.25 * data[3 * n + 1]
138
            else:
139
                return 0.25 * data[3 * n + 1] + 0.75 * data[3 * n + 2]
140
        else:  # Method 2
141
            return statistics.median(data[rounds // 2:])
142
143
    @cached_property
144
    def iqr(self):
@@ 115-124 (lines=10) @@
112
        data = self.sorted_data
113
114
        # See: https://en.wikipedia.org/wiki/Quartile#Computing_methods
115
        if rounds == 1:
116
            return data[0]
117
        elif rounds % 2:  # Method 3
118
            n, q = rounds // 4, rounds % 4
119
            if q == 1:
120
                return 0.25 * data[n - 1] + 0.75 * data[n]
121
            else:
122
                return 0.75 * data[n] + 0.25 * data[n + 1]
123
        else:  # Method 2
124
            return statistics.median(data[:rounds // 2])
125
126
    @cached_property
127
    def q3(self):