web/public/s/js/alert.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 26
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2
mnd 0
bc 0
fnc 2
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A alert.js ➔ addAlert 0 22 1
1
function showAlert(id) {
2
    $(id).fadeIn();
3
}
4
5
function addAlert(id, text) {
6
    $(".alerts-2012").append(
7
        `
8
        <div id="alerts" class="content-alignment" style="margin-top:3px;">
9
            <div class="yt-alert yt-alert-default yt-alert-info hid" id="alert__` + id + `" style="display: block;">
10
                <div class="yt-alert-icon">
11
                    <img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
12
                </div>
13
                <div class="yt-alert-buttons"><button type="button" class="close yt-uix-close yt-uix-button yt-uix-button-close yt-uix-button-size-default" onclick="this.parent.style.display = 'none';" data-close-parent-class="yt-alert" role="button"><span class="yt-uix-button-content">Close </span></button></div>
14
                <div class="yt-alert-content" role="alert">
15
                    <span class="yt-alert-vertical-trick"></span>
16
                    <div class="yt-alert-message">
17
                        ` + text + `
18
                    </div>
19
                </div>
20
            </div>
21
        </div>
22
        `
23
    );
24
25
    return "Alert created " + id + text;
26
}