com.strider.datadefender.extensions.ExtensionExample   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 8
ccs 0
cts 2
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A randomStudentNumber() 0 2 1
1
/*
2
 * Copyright 2014, Armenak Grigoryan, and individual contributors as indicated
3
 * by the @authors tag. See the copyright.txt in the distribution for a
4
 * full listing of individual contributors.
5
 *
6
 * This is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU Lesser General Public License as
8
 * published by the Free Software Foundation; either version 2.1 of
9
 * the License, or (at your option) any later version.
10
 *
11
 * This software is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
 * Lesser General Public License for more details.
15
 */
16
package com.strider.datadefender.extensions;
17
18
import com.strider.datadefender.anonymizer.functions.Core;
19
20
import static java.lang.Math.random;
21
import static java.lang.Math.round;
22
import static java.lang.String.valueOf;
23
24
/**
25
 * @author Armenak Grigoryan
26
 */
27
public class ExtensionExample extends Core {
28
29
    /**
30
     * Generates random 9-digit student number
31
     * @return String
32
     */
33
    public String randomStudentNumber() {
34
        return valueOf(round(random() * 100000000));
35
    }
36
}
37