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.

io.mcarle.sciurus.monitor.MonitorAspect   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 14
c 2
b 0
f 0
dl 0
loc 26
ccs 4
cts 4
cp 1
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A anyMethod() 0 2 1
A monitorAnnotated(Monitor) 0 2 1
A startedAndExecutionOfAnyMethodAnnotatedWithMonitor(ProceedingJoinPoint,Monitor) 0 9 2
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