Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
unit and acceptance tests added, code qualite tested as well
- Loading branch information
Showing
20 changed files
with
10,247 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
{ | ||
"env": { | ||
"es6": true, | ||
"jasmine": true, | ||
"node": true, | ||
"browser": true, | ||
"jest": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 8 | ||
}, | ||
"rules": { | ||
"arrow-body-style": 2, | ||
"arrow-spacing": ["warn", {"before": true, "after": true}], | ||
"brace-style": 2, | ||
"camelcase": [2, {"properties": "never"}], | ||
"complexity": ["error", 10], | ||
"eol-last": "warn", | ||
"eqeqeq": "error", | ||
"func-call-spacing": ["error", "never"], | ||
"global-require": "error", | ||
"handle-callback-err": "warn", | ||
"indent": [1, "tab", {"SwitchCase": 1}], | ||
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}], | ||
"linebreak-style": ["warn", "unix"], | ||
"max-depth": ["error", 3], | ||
"max-len": ["warn", { "code": 120, "tabWidth": 4 }], | ||
"max-lines": ["warn", 150], | ||
"max-lines-per-function": ["error", 20], | ||
"max-nested-callbacks": ["error", 4], | ||
"max-params": ["error", 5], | ||
"max-statements": ["error", 20], | ||
"no-cond-assign": 2, | ||
"no-dupe-args": "error", | ||
"no-dupe-keys": "error", | ||
"no-duplicate-case": "error", | ||
"no-empty": "warn", | ||
"no-empty-function": 2, | ||
"no-multiple-empty-lines": "warn", | ||
"no-extra-parens": 2, | ||
"no-func-assign": 2, | ||
"no-irregular-whitespace": 2, | ||
"no-magic-numbers": [1, {"ignore": [-1, 0, 1]}], | ||
"no-multi-spaces": 1, | ||
"no-multi-str": 1, | ||
"no-unexpected-multiline": 2, | ||
"no-unreachable": 2, | ||
"no-self-assign": 2, | ||
"no-trailing-spaces": 1, | ||
"no-undef": 2, | ||
"no-unused-vars": 1, | ||
"no-var": 2, | ||
"prefer-arrow-callback": 1, | ||
"prefer-const": 2, | ||
"prefer-template": "error", | ||
"quotes": [1, "single"], | ||
"semi": [1, "never"], | ||
"space-before-blocks": ["error", { "functions": "always", "keywords": "always", "classes": "always" }], | ||
"space-before-function-paren": [2, "never"], | ||
"strict": [2, "global"], | ||
"yoda": 2 | ||
}, | ||
"overrides": [{ | ||
"files": [ "*.test.js", "*.spec.js", "sqlite-async.js" ], | ||
"rules": { | ||
"global-require": "off", | ||
"max-lines-per-function": "off", | ||
"max-lines": "off", | ||
"max-statements": "off", | ||
"no-magic-numbers": "off" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<coverage generated="1587684191338" clover="3.2.0"> | ||
<project timestamp="1587684191338" name="All files"> | ||
<metrics statements="34" coveredstatements="34" conditionals="17" coveredconditionals="17" methods="4" coveredmethods="4" elements="55" coveredelements="55" complexity="0" loc="34" ncloc="34" packages="1" files="1" classes="1"/> | ||
<file name="user.js" path="/mnt/c/Users/bruno/OneDrive/Documentos/5001 Project/project/modules/user.js"> | ||
<metrics statements="34" coveredstatements="34" conditionals="17" coveredconditionals="17" methods="4" coveredmethods="4"/> | ||
<line num="5" count="1" type="stmt"/> | ||
<line num="8" count="1" type="stmt"/> | ||
<line num="9" count="1" type="stmt"/> | ||
<line num="10" count="1" type="stmt"/> | ||
<line num="12" count="1" type="stmt"/> | ||
<line num="15" count="10" type="stmt"/> | ||
<line num="16" count="10" type="stmt"/> | ||
<line num="18" count="10" type="stmt"/> | ||
<line num="19" count="10" type="stmt"/> | ||
<line num="20" count="10" type="stmt"/> | ||
<line num="26" count="11" type="stmt"/> | ||
<line num="27" count="11" type="cond" truecount="2" falsecount="0"/> | ||
<line num="28" count="10" type="cond" truecount="2" falsecount="0"/> | ||
<line num="29" count="9" type="cond" truecount="2" falsecount="0"/> | ||
<line num="30" count="8" type="cond" truecount="2" falsecount="0"/> | ||
<line num="31" count="7" type="cond" truecount="2" falsecount="0"/> | ||
<line num="33" count="6" type="stmt"/> | ||
<line num="34" count="6" type="stmt"/> | ||
<line num="35" count="6" type="cond" truecount="2" falsecount="0"/> | ||
<line num="36" count="5" type="stmt"/> | ||
<line num="37" count="5" type="stmt"/> | ||
<line num="38" count="5" type="stmt"/> | ||
<line num="39" count="5" type="stmt"/> | ||
<line num="41" count="6" type="stmt"/> | ||
<line num="47" count="3" type="stmt"/> | ||
<line num="48" count="3" type="stmt"/> | ||
<line num="49" count="3" type="stmt"/> | ||
<line num="51" count="3" type="cond" truecount="2" falsecount="0"/> | ||
<line num="52" count="2" type="stmt"/> | ||
<line num="53" count="2" type="stmt"/> | ||
<line num="55" count="2" type="stmt"/> | ||
<line num="56" count="2" type="cond" truecount="2" falsecount="0"/> | ||
<line num="57" count="1" type="stmt"/> | ||
<line num="59" count="2" type="stmt"/> | ||
</file> | ||
</project> | ||
</coverage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"/mnt/c/Users/bruno/OneDrive/Documentos/5001 Project/project/modules/user.js": {"path":"/mnt/c/Users/bruno/OneDrive/Documentos/5001 Project/project/modules/user.js","statementMap":{"0":{"start":{"line":5,"column":15},"end":{"line":5,"column":40}},"1":{"start":{"line":8,"column":13},"end":{"line":8,"column":34}},"2":{"start":{"line":9,"column":15},"end":{"line":9,"column":38}},"3":{"start":{"line":10,"column":19},"end":{"line":10,"column":21}},"4":{"start":{"line":12,"column":0},"end":{"line":63,"column":1}},"5":{"start":{"line":15,"column":2},"end":{"line":21,"column":6}},"6":{"start":{"line":16,"column":3},"end":{"line":16,"column":38}},"7":{"start":{"line":18,"column":15},"end":{"line":18,"column":160}},"8":{"start":{"line":19,"column":3},"end":{"line":19,"column":25}},"9":{"start":{"line":20,"column":3},"end":{"line":20,"column":14}},"10":{"start":{"line":26,"column":2},"end":{"line":42,"column":3}},"11":{"start":{"line":27,"column":3},"end":{"line":27,"column":61}},"12":{"start":{"line":27,"column":26},"end":{"line":27,"column":61}},"13":{"start":{"line":28,"column":3},"end":{"line":28,"column":61}},"14":{"start":{"line":28,"column":26},"end":{"line":28,"column":61}},"15":{"start":{"line":29,"column":3},"end":{"line":29,"column":57}},"16":{"start":{"line":29,"column":26},"end":{"line":29,"column":57}},"17":{"start":{"line":30,"column":3},"end":{"line":30,"column":59}},"18":{"start":{"line":30,"column":27},"end":{"line":30,"column":59}},"19":{"start":{"line":31,"column":3},"end":{"line":31,"column":63}},"20":{"start":{"line":31,"column":29},"end":{"line":31,"column":63}},"21":{"start":{"line":33,"column":13},"end":{"line":33,"column":75}},"22":{"start":{"line":34,"column":16},"end":{"line":34,"column":38}},"23":{"start":{"line":35,"column":3},"end":{"line":35,"column":79}},"24":{"start":{"line":35,"column":27},"end":{"line":35,"column":79}},"25":{"start":{"line":36,"column":3},"end":{"line":36,"column":45}},"26":{"start":{"line":37,"column":3},"end":{"line":37,"column":132}},"27":{"start":{"line":38,"column":3},"end":{"line":38,"column":25}},"28":{"start":{"line":39,"column":3},"end":{"line":39,"column":14}},"29":{"start":{"line":41,"column":3},"end":{"line":41,"column":12}},"30":{"start":{"line":47,"column":2},"end":{"line":60,"column":3}},"31":{"start":{"line":48,"column":13},"end":{"line":48,"column":73}},"32":{"start":{"line":49,"column":19},"end":{"line":49,"column":41}},"33":{"start":{"line":51,"column":3},"end":{"line":51,"column":70}},"34":{"start":{"line":51,"column":23},"end":{"line":51,"column":70}},"35":{"start":{"line":52,"column":3},"end":{"line":52,"column":57}},"36":{"start":{"line":53,"column":18},"end":{"line":53,"column":40}},"37":{"start":{"line":55,"column":17},"end":{"line":55,"column":56}},"38":{"start":{"line":56,"column":3},"end":{"line":56,"column":81}},"39":{"start":{"line":56,"column":24},"end":{"line":56,"column":81}},"40":{"start":{"line":57,"column":3},"end":{"line":57,"column":14}},"41":{"start":{"line":59,"column":3},"end":{"line":59,"column":12}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":14,"column":1},"end":{"line":14,"column":2}},"loc":{"start":{"line":14,"column":34},"end":{"line":22,"column":2}},"line":14},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":10},"end":{"line":15,"column":11}},"loc":{"start":{"line":15,"column":21},"end":{"line":21,"column":3}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":1},"end":{"line":25,"column":2}},"loc":{"start":{"line":25,"column":50},"end":{"line":43,"column":2}},"line":25},"3":{"name":"(anonymous_3)","decl":{"start":{"line":46,"column":1},"end":{"line":46,"column":2}},"loc":{"start":{"line":46,"column":25},"end":{"line":61,"column":2}},"line":46}},"branchMap":{"0":{"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":32}},"type":"default-arg","locations":[{"start":{"line":14,"column":22},"end":{"line":14,"column":32}}],"line":14},"1":{"loc":{"start":{"line":27,"column":3},"end":{"line":27,"column":61}},"type":"if","locations":[{"start":{"line":27,"column":3},"end":{"line":27,"column":61}},{"start":{"line":27,"column":3},"end":{"line":27,"column":61}}],"line":27},"2":{"loc":{"start":{"line":28,"column":3},"end":{"line":28,"column":61}},"type":"if","locations":[{"start":{"line":28,"column":3},"end":{"line":28,"column":61}},{"start":{"line":28,"column":3},"end":{"line":28,"column":61}}],"line":28},"3":{"loc":{"start":{"line":29,"column":3},"end":{"line":29,"column":57}},"type":"if","locations":[{"start":{"line":29,"column":3},"end":{"line":29,"column":57}},{"start":{"line":29,"column":3},"end":{"line":29,"column":57}}],"line":29},"4":{"loc":{"start":{"line":30,"column":3},"end":{"line":30,"column":59}},"type":"if","locations":[{"start":{"line":30,"column":3},"end":{"line":30,"column":59}},{"start":{"line":30,"column":3},"end":{"line":30,"column":59}}],"line":30},"5":{"loc":{"start":{"line":31,"column":3},"end":{"line":31,"column":63}},"type":"if","locations":[{"start":{"line":31,"column":3},"end":{"line":31,"column":63}},{"start":{"line":31,"column":3},"end":{"line":31,"column":63}}],"line":31},"6":{"loc":{"start":{"line":35,"column":3},"end":{"line":35,"column":79}},"type":"if","locations":[{"start":{"line":35,"column":3},"end":{"line":35,"column":79}},{"start":{"line":35,"column":3},"end":{"line":35,"column":79}}],"line":35},"7":{"loc":{"start":{"line":51,"column":3},"end":{"line":51,"column":70}},"type":"if","locations":[{"start":{"line":51,"column":3},"end":{"line":51,"column":70}},{"start":{"line":51,"column":3},"end":{"line":51,"column":70}}],"line":51},"8":{"loc":{"start":{"line":56,"column":3},"end":{"line":56,"column":81}},"type":"if","locations":[{"start":{"line":56,"column":3},"end":{"line":56,"column":81}},{"start":{"line":56,"column":3},"end":{"line":56,"column":81}}],"line":56}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":10,"6":10,"7":10,"8":10,"9":10,"10":11,"11":11,"12":1,"13":10,"14":1,"15":9,"16":1,"17":8,"18":1,"19":7,"20":1,"21":6,"22":6,"23":6,"24":1,"25":5,"26":5,"27":5,"28":5,"29":6,"30":3,"31":3,"32":3,"33":3,"34":1,"35":2,"36":2,"37":2,"38":2,"39":1,"40":1,"41":2},"f":{"0":10,"1":10,"2":11,"3":3},"b":{"0":[10],"1":[1,10],"2":[1,9],"3":[1,8],"4":[1,7],"5":[1,6],"6":[1,5],"7":[1,2],"8":[1,1]},"_coverageSchema":"43e27e138ebf9cfc5966b082cf9a028302ed4184","hash":"0088e4cff6a62152aa6a6065864ac327acd4efb0"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
body, html { | ||
margin:0; padding: 0; | ||
height: 100%; | ||
} | ||
body { | ||
font-family: Helvetica Neue, Helvetica, Arial; | ||
font-size: 14px; | ||
color:#333; | ||
} | ||
.small { font-size: 12px; } | ||
*, *:after, *:before { | ||
-webkit-box-sizing:border-box; | ||
-moz-box-sizing:border-box; | ||
box-sizing:border-box; | ||
} | ||
h1 { font-size: 20px; margin: 0;} | ||
h2 { font-size: 14px; } | ||
pre { | ||
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; | ||
margin: 0; | ||
padding: 0; | ||
-moz-tab-size: 2; | ||
-o-tab-size: 2; | ||
tab-size: 2; | ||
} | ||
a { color:#0074D9; text-decoration:none; } | ||
a:hover { text-decoration:underline; } | ||
.strong { font-weight: bold; } | ||
.space-top1 { padding: 10px 0 0 0; } | ||
.pad2y { padding: 20px 0; } | ||
.pad1y { padding: 10px 0; } | ||
.pad2x { padding: 0 20px; } | ||
.pad2 { padding: 20px; } | ||
.pad1 { padding: 10px; } | ||
.space-left2 { padding-left:55px; } | ||
.space-right2 { padding-right:20px; } | ||
.center { text-align:center; } | ||
.clearfix { display:block; } | ||
.clearfix:after { | ||
content:''; | ||
display:block; | ||
height:0; | ||
clear:both; | ||
visibility:hidden; | ||
} | ||
.fl { float: left; } | ||
@media only screen and (max-width:640px) { | ||
.col3 { width:100%; max-width:100%; } | ||
.hide-mobile { display:none!important; } | ||
} | ||
|
||
.quiet { | ||
color: #7f7f7f; | ||
color: rgba(0,0,0,0.5); | ||
} | ||
.quiet a { opacity: 0.7; } | ||
|
||
.fraction { | ||
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; | ||
font-size: 10px; | ||
color: #555; | ||
background: #E8E8E8; | ||
padding: 4px 5px; | ||
border-radius: 3px; | ||
vertical-align: middle; | ||
} | ||
|
||
div.path a:link, div.path a:visited { color: #333; } | ||
table.coverage { | ||
border-collapse: collapse; | ||
margin: 10px 0 0 0; | ||
padding: 0; | ||
} | ||
|
||
table.coverage td { | ||
margin: 0; | ||
padding: 0; | ||
vertical-align: top; | ||
} | ||
table.coverage td.line-count { | ||
text-align: right; | ||
padding: 0 5px 0 20px; | ||
} | ||
table.coverage td.line-coverage { | ||
text-align: right; | ||
padding-right: 10px; | ||
min-width:20px; | ||
} | ||
|
||
table.coverage td span.cline-any { | ||
display: inline-block; | ||
padding: 0 5px; | ||
width: 100%; | ||
} | ||
.missing-if-branch { | ||
display: inline-block; | ||
margin-right: 5px; | ||
border-radius: 3px; | ||
position: relative; | ||
padding: 0 4px; | ||
background: #333; | ||
color: yellow; | ||
} | ||
|
||
.skip-if-branch { | ||
display: none; | ||
margin-right: 10px; | ||
position: relative; | ||
padding: 0 4px; | ||
background: #ccc; | ||
color: white; | ||
} | ||
.missing-if-branch .typ, .skip-if-branch .typ { | ||
color: inherit !important; | ||
} | ||
.coverage-summary { | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
.coverage-summary tr { border-bottom: 1px solid #bbb; } | ||
.keyline-all { border: 1px solid #ddd; } | ||
.coverage-summary td, .coverage-summary th { padding: 10px; } | ||
.coverage-summary tbody { border: 1px solid #bbb; } | ||
.coverage-summary td { border-right: 1px solid #bbb; } | ||
.coverage-summary td:last-child { border-right: none; } | ||
.coverage-summary th { | ||
text-align: left; | ||
font-weight: normal; | ||
white-space: nowrap; | ||
} | ||
.coverage-summary th.file { border-right: none !important; } | ||
.coverage-summary th.pct { } | ||
.coverage-summary th.pic, | ||
.coverage-summary th.abs, | ||
.coverage-summary td.pct, | ||
.coverage-summary td.abs { text-align: right; } | ||
.coverage-summary td.file { white-space: nowrap; } | ||
.coverage-summary td.pic { min-width: 120px !important; } | ||
.coverage-summary tfoot td { } | ||
|
||
.coverage-summary .sorter { | ||
height: 10px; | ||
width: 7px; | ||
display: inline-block; | ||
margin-left: 0.5em; | ||
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; | ||
} | ||
.coverage-summary .sorted .sorter { | ||
background-position: 0 -20px; | ||
} | ||
.coverage-summary .sorted-desc .sorter { | ||
background-position: 0 -10px; | ||
} | ||
.status-line { height: 10px; } | ||
/* yellow */ | ||
.cbranch-no { background: yellow !important; color: #111; } | ||
/* dark red */ | ||
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } | ||
.low .chart { border:1px solid #C21F39 } | ||
.highlighted, | ||
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ | ||
background: #C21F39 !important; | ||
} | ||
/* medium red */ | ||
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } | ||
/* light red */ | ||
.low, .cline-no { background:#FCE1E5 } | ||
/* light green */ | ||
.high, .cline-yes { background:rgb(230,245,208) } | ||
/* medium green */ | ||
.cstat-yes { background:rgb(161,215,106) } | ||
/* dark green */ | ||
.status-line.high, .high .cover-fill { background:rgb(77,146,33) } | ||
.high .chart { border:1px solid rgb(77,146,33) } | ||
/* dark yellow (gold) */ | ||
.status-line.medium, .medium .cover-fill { background: #f9cd0b; } | ||
.medium .chart { border:1px solid #f9cd0b; } | ||
/* light yellow */ | ||
.medium { background: #fff4c2; } | ||
|
||
.cstat-skip { background: #ddd; color: #111; } | ||
.fstat-skip { background: #ddd; color: #111 !important; } | ||
.cbranch-skip { background: #ddd !important; color: #111; } | ||
|
||
span.cline-neutral { background: #eaeaea; } | ||
|
||
.coverage-summary td.empty { | ||
opacity: .5; | ||
padding-top: 4px; | ||
padding-bottom: 4px; | ||
line-height: 1; | ||
color: #888; | ||
} | ||
|
||
.cover-fill, .cover-empty { | ||
display:inline-block; | ||
height: 12px; | ||
} | ||
.chart { | ||
line-height: 0; | ||
} | ||
.cover-empty { | ||
background: white; | ||
} | ||
.cover-full { | ||
border-right: none !important; | ||
} | ||
pre.prettyprint { | ||
border: none !important; | ||
padding: 0 !important; | ||
margin: 0 !important; | ||
} | ||
.com { color: #999 !important; } | ||
.ignore-none { color: #999; font-weight: normal; } | ||
|
||
.wrapper { | ||
min-height: 100%; | ||
height: auto !important; | ||
height: 100%; | ||
margin: 0 auto -48px; | ||
} | ||
.footer, .push { | ||
height: 48px; | ||
} |
Oops, something went wrong.