GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

executeAndMeasure(ProceedingJoinPoint)   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 26
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 20
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 23
c 1
b 0
f 0
dl 0
loc 26
ccs 20
cts 20
cp 1
crap 2
rs 9.328
1
package io.mcarle.sciurus.monitor;
2
3
import org.aspectj.lang.ProceedingJoinPoint;
4
import org.aspectj.lang.reflect.MethodSignature;
5
6
import java.time.Duration;
7
import java.time.temporal.ChronoUnit;
8
9 1
class MonitorAspectHandler {
10
11
    static Object executeAndMeasure(ProceedingJoinPoint joinPoint) throws Throwable {
12 1
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
13
14 1
        Object returnValue = null;
15 1
        Throwable throwable = null;
16 1
        long duration = 0;
17 1
        long before = System.nanoTime();
18
        try {
19 1
            returnValue = joinPoint.proceed();
20 1
            duration = System.nanoTime() - before;
21 1
        } catch (Throwable t) {
22 1
            duration = System.nanoTime() - before;
23 1
            throwable = t;
24 1
            throw t;
25
        } finally {
26 1
            MonitorRegister.INSTANCE.notifyRegisteredMonitors(
27 1
                    Duration.of(duration, ChronoUnit.NANOS),
28 1
                    signature.getDeclaringTypeName(),
29 1
                    signature.getMethod(),
30 1
                    joinPoint.getArgs(),
31 1
                    throwable,
32 1
                    signature.getReturnType(),
33 1
                    returnValue
34
            );
35
        }
36 1
        return returnValue;
37
    }
38
}
39