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.

startedAndExecutionOfAnyMethodAnnotatedWithMonitor(ProceedingJoinPoint,Monitor)   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 9
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 2
b 0
f 0
dl 0
loc 9
ccs 3
cts 3
cp 1
crap 2
rs 9.95
1 1
package io.mcarle.sciurus.monitor;
2
3
import io.mcarle.sciurus.Sciurus;
4
import io.mcarle.sciurus.annotation.Monitor;
5
import org.aspectj.lang.ProceedingJoinPoint;
6
import org.aspectj.lang.annotation.Around;
7
import org.aspectj.lang.annotation.Aspect;
8
import org.aspectj.lang.annotation.Pointcut;
9
10
@Aspect
11 1
public class MonitorAspect {
12
13
    /**
14
     * Matches any execution of any method
15
     */
16
    @Pointcut("execution(* *(..))")
17
    void anyMethod() {
18
    }
19
20
    /**
21
     * Matches any method, which is annotated with {@link Monitor}
22
     */
23
    @Pointcut("@annotation(monitor)")
24
    void monitorAnnotated(Monitor monitor) {
25
    }
26
27
    @Around(value = "anyMethod() && monitorAnnotated(monitor)", argNames = "joinPoint,monitor")
28
    public Object startedAndExecutionOfAnyMethodAnnotatedWithMonitor(
29
            ProceedingJoinPoint joinPoint,
30
            Monitor monitor
31
    ) throws Throwable {
32 1
        if (Sciurus.isMonitorStarted()) {
33 1
            return MonitorAspectHandler.executeAndMeasure(joinPoint);
34
        } else {
35 1
            return joinPoint.proceed();
36
        }
37
    }
38
39
}
40