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.

decodeKey(ByteBuffer)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
1
package io.mcarle.sciurus.cache.redis;
0 ignored issues
show
Code Smell introduced by
It is a best practice to supply a copyright/licence header in your code. Your organisation probably has a template for that.
Loading history...
2
3
import io.lettuce.core.codec.RedisCodec;
4
5
import java.nio.ByteBuffer;
6
import java.nio.charset.StandardCharsets;
7
8 1
public class RedisJsonCodec implements RedisCodec<String, RedisData> {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
9
10
    @Override
11
    public String decodeKey(final ByteBuffer bytes) {
0 ignored issues
show
Coding Style introduced by
Make this line start at column 3.
Loading history...
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
12 1
        return StandardCharsets.UTF_8.decode(bytes).toString();
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
13
    }
14
15
    @Override
16
    public RedisData decodeValue(final ByteBuffer bytes) {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
17 1
        return RedisData.fromByteBuffer(bytes);
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
18
    }
19
20
    @Override
21
    public ByteBuffer encodeKey(final String key) {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
22 1
        return StandardCharsets.UTF_8.encode(key);
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
23
    }
24
25
    @Override
26
    public ByteBuffer encodeValue(final RedisData value) {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
27 1
        return RedisData.toByteBuffer(value);
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
28
    }
29
}
30