Commit a03871aa authored by chickahoona's avatar chickahoona

more codeclimate changes

parent 4f5a6119
......@@ -7,6 +7,9 @@ engines:
enabled: false
duplication:
enabled: true
checks:
Identical code:
enabled: false
config:
languages:
- javascript
......@@ -14,6 +17,9 @@ engines:
enabled: true
fixme:
enabled: true
checks:
TODO:
enabled: false
ratings:
paths:
- "**.css"
......
# PSONO Server - Password Manager
Master: [![build status](https://images.microbadger.com/badges/image/psono/psono-client.svg)](https://hub.docker.com/r/psono/psono-client/)[![build status](https://gitlab.com/psono/psono-client/badges/master/build.svg)](https://gitlab.com/psono/psono-client/commits/master) [![coverage report](https://gitlab.com/psono/psono-client/badges/master/coverage.svg)](https://gitlab.com/psono/psono-client/commits/master)
Master: [![Code Climate](https://codeclimate.com/github/psono/psono-client/badges/gpa.svg)](https://codeclimate.com/github/psono/psono-client) [![build status](https://images.microbadger.com/badges/image/psono/psono-client.svg)](https://hub.docker.com/r/psono/psono-client/) [![build status](https://gitlab.com/psono/psono-client/badges/master/build.svg)](https://gitlab.com/psono/psono-client/commits/master) [![coverage report](https://gitlab.com/psono/psono-client/badges/master/coverage.svg)](https://gitlab.com/psono/psono-client/commits/master)
Develop: [![build status](https://gitlab.com/psono/psono-client/badges/develop/build.svg)](https://gitlab.com/psono/psono-client/commits/develop) [![coverage report](https://gitlab.com/psono/psono-client/badges/develop/coverage.svg)](https://gitlab.com/psono/psono-client/commits/develop)
# Canonical source
......
......@@ -9,7 +9,8 @@ var sass = require('gulp-sass');
var template_cache = require('gulp-angular-templatecache');
var crx = require('gulp-crx-pack');
var fs = require("fs");
var path = require('path-extra');
var path = require('path');
var ospath = require('ospath');
var child_process = require('child_process');
var jeditor = require("gulp-json-editor");
var karma_server = require('karma').Server;
......@@ -188,15 +189,14 @@ gulp.task('watchpost', function() {
* creates the crx and update file for Chrome
*/
gulp.task('crx', function() {
var manifest = require('./build/chrome/manifest.json');
var manifest = JSON.parse(fs.readFileSync('./build/chrome/manifest.json'));
var codebase = manifest.codebase;
var updateXmlFilename = 'psono.PW.update.xml';
return gulp.src('./build/chrome')
.pipe(crx({
privateKey: fs.readFileSync(path.homedir() + '/.psono_client/certs/key', 'utf8'),
privateKey: fs.readFileSync(ospath.home() + '/.psono_client/certs/key', 'utf8'),
filename: manifest.name + '.crx',
codebase: codebase,
updateXmlFilename: updateXmlFilename
......@@ -298,7 +298,7 @@ gulp.task('docs', [], function () {
*/
gulp.task('unittest', function (done) {
new karma_server({
configFile: __dirname + '/unittests/karma-chrome.conf.js',
configFile: path.join(__dirname, 'unittests', 'karma-chrome.conf.js'),
singleRun: true
}, done).start();
});
......@@ -308,7 +308,7 @@ gulp.task('unittest', function (done) {
*/
gulp.task('unittestwatch', function (done) {
new karma_server({
configFile: __dirname + '/unittests/karma-chrome.conf.js',
configFile: path.join(__dirname, 'unittests', 'karma-chrome.conf.js'),
singleRun: false
}, done).start();
});
......@@ -26,6 +26,8 @@
background: #FFF;
padding: 2px;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
border: 1px solid #bababa; }
.psono-pw-drop-element.psono-pw-drop-theme-arrows .psono-pw-drop-content a {
......
......@@ -78,7 +78,7 @@ body {
background-color: #151f2b;
border-color: #122b40; }
label.smalllabel {
.smalllabel {
font-size: small;
margin-bottom: 0;
margin-top: 5px;
......
/*fbfbfc*/
html {
padding: 10px;
height: auto; }
......@@ -3,19 +3,22 @@
body {
font-family: 'Open Sans', sans-serif;
position: relative;
min-width: 180px;
background-color: #0f1118;
margin: 0;
padding: 0; }
padding: 0;
min-width: 320px; }
h1, h2 {
font-size: 20px;
margin: 0; }
#panel {
padding: 10px; }
#logo {
margin-bottom: 10px; }
.loginbox span.pull-right {
.loginbox .pull-right {
line-height: 31px; }
.loginbox .box-footer {
......@@ -155,9 +158,6 @@ h1, h2 {
width: 15px; }
/* classes for error handling */
.form-group .help-block {
/* display: none; */ }
.form-group.has-error .help-block {
display: block; }
......
......@@ -289,4 +289,4 @@
main();
});
})(browserClient, jQuery);
\ No newline at end of file
}(browserClient, jQuery));
\ No newline at end of file
......@@ -1770,7 +1770,7 @@
$scope.routeParams = $routeParams;
}]);
})(angular, uuid);
}(angular, uuid));
/* creates the base href tag for angular location */
......
......@@ -413,7 +413,7 @@
return uuid.unparse(from_hex(val));
};
var Mnemonic = function () {
var Mnemonic = (function () {
// Mnemonic.js v. 1.1.0
......@@ -495,7 +495,7 @@
};
return Mnemonic;
}();
}());
/**
* @ngdoc
......
......@@ -589,7 +589,7 @@
*/
var find_in_structure = function (path, structure) {
var to_search = path.shift();
var n = undefined;
var n;
if (path.length === 0) {
// found the object
......
......@@ -238,6 +238,26 @@
return datastore;
}
var read_share_helper = function (share_id, sub_datastore, path, parent_share_id, parent_datastore_id) {
var onSuccess = function (content) {
all_share_data[share_id] = content;
update_paths_with_data(datastore, path, content, parent_share_rights, parent_share_id, parent_datastore_id);
rights = calculate_user_share_rights(content);
read_shares_recursive(sub_datastore, share_rights_dict, content.data.share_index, all_share_data, rights, share_id, undefined);
open_calls--;
};
var onError = function () {
open_calls--;
};
open_calls++;
return managerShare.read_share(share_id, share_index[share_id].secret_key)
.then(onSuccess, onError);
};
for (var share_id in share_index) {
if (!share_index.hasOwnProperty(share_id)) {
continue;
......@@ -270,25 +290,7 @@
continue;
}
all_calls.push((function (share_id, sub_datastore, path, parent_share_id, parent_datastore_id) {
var onSuccess = function (content) {
all_share_data[share_id] = content;
update_paths_with_data(datastore, path, content, parent_share_rights, parent_share_id, parent_datastore_id);
rights = calculate_user_share_rights(content);
read_shares_recursive(sub_datastore, share_rights_dict, content.data.share_index, all_share_data, rights, share_id, undefined);
open_calls--;
};
var onError = function () {
open_calls--;
};
open_calls++;
return managerShare.read_share(share_id, share_index[share_id].secret_key)
.then(onSuccess, onError);
})(share_id, sub_datastore, share_index[share_id].paths[i], parent_share_id, parent_datastore_id));
all_calls.push(read_share_helper(share_id, sub_datastore, share_index[share_id].paths[i], parent_share_id, parent_datastore_id));
}
}
......@@ -611,7 +613,7 @@
*/
var find_in_datastore = function (path, datastore) {
var to_search = undefined;
var to_search;
var i, n, l;
......
......@@ -161,7 +161,7 @@
}
}
if (data.status = 404) {
if (data.status === 404) {
form_control['block_submit'] = true;
errors.push("User not found.");
} else {
......
......@@ -262,4 +262,4 @@
})(angular);
\ No newline at end of file
}(angular));
\ No newline at end of file
......@@ -274,4 +274,4 @@
}]);
})(angular);
\ No newline at end of file
}(angular));
\ No newline at end of file
......@@ -113,11 +113,11 @@
if (!content.fields[i].hasOwnProperty("value")) {
continue;
}
if (!user_object.name && content.title_field == content.fields[i].name) {
if (!user_object.name && content.title_field === content.fields[i].name) {
user_object.name = content.fields[i].value;
}
if (content.hasOwnProperty("urlfilter_field")
&& content.urlfilter_field == content.fields[i].name) {
&& content.urlfilter_field === content.fields[i].name) {
user_object.urlfilter = content.fields[i].value;
}
user_object.data[content.fields[i].name] = content.fields[i].value;
......@@ -179,13 +179,13 @@
}
// found title and if title not yet set , lets save it as title
if (!new_name && content.title_field == content.fields[i].name) {
if (!new_name && content.title_field === content.fields[i].name) {
node.name = content.fields[i].value;
}
// found a urlfilter field, lets put it into our urlfilter
if (content.hasOwnProperty("urlfilter_field")
&& content.urlfilter_field == content.fields[i].name) {
&& content.urlfilter_field === content.fields[i].name) {
node.urlfilter = content.fields[i].value;
}
......@@ -554,4 +554,4 @@
}
}]);
})(angular, uuid);
\ No newline at end of file
}(angular, uuid));
\ No newline at end of file
......@@ -103,7 +103,7 @@ body {
border-color: #122b40;
}
label.smalllabel {
.smalllabel {
font-size: small;
margin-bottom: 0;
margin-top: 5px;
......
......@@ -25,7 +25,7 @@ h1, h2 {
margin-bottom: 10px;
}
.loginbox {
span.pull-right {
.pull-right {
line-height: 31px;
}
......@@ -224,9 +224,6 @@ h1, h2 {
}
/* classes for error handling */
.form-group .help-block {
/* display: none; */
}
.form-group.has-error .help-block {
display: block;
......
......@@ -147,7 +147,7 @@
*/
var _get_config = function(key) {
if (typeof(key) == 'undefined') {
if (typeof(key) === 'undefined') {
return config;
}
if (config.hasOwnProperty(key)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment