Skip to content

Firefly III: a personal finances manager

Some fixes for code climate.

James Cole8743b49a172b
diff --git a/.codeclimate.yml b/.codeclimate.yml
index 9c6d37baf6..3beadbce4a 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -3,6 +3,7 @@ languages:
JavaScript: true
PHP: true
exclude_paths:
+- "gulpfile.js"
- "public/packages/maximebf/php-debugbar/debugbar.js"
- "public/packages/maximebf/php-debugbar/widgets.js"
- "public/packages/maximebf/php-debugbar/openhandler.js"
diff --git a/public/js/accounts.js b/public/js/accounts.js
index 9c9e43a4fb..80c908f7a9 100644
--- a/public/js/accounts.js
+++ b/public/js/accounts.js
@@ -4,6 +4,7 @@
// Return a helper with preserved width of cells
var fixHelper = function(e, tr)
{
+ "use strict";
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function(index)
@@ -84,4 +85,4 @@ function sortStop(event, ui) {
//check if the item above OR under this one have the same date
//if not. return false
-}
\ No newline at end of file
+}
diff --git a/public/js/rules/create.js b/public/js/rules/create.js
index 5fe38cb550..e9bf3776bc 100644
--- a/public/js/rules/create.js
+++ b/public/js/rules/create.js
@@ -1,3 +1,4 @@
+/* global $, addNewTrigger, addNewAction, actionCount, triggerCount */
/*
* edit.js
* Copyright (C) 2016 Sander Dorigo
@@ -11,10 +12,10 @@
$(function () {
"use strict";
console.log("edit");
- if (triggerCount == 0) {
+ if (triggerCount === 0) {
addNewTrigger();
}
- if (actionCount == 0) {
+ if (actionCount === 0) {
addNewAction();
}
diff --git a/public/js/rules/index.js b/public/js/rules/index.js
index 9c73dd7d17..25b812fecd 100644
--- a/public/js/rules/index.js
+++ b/public/js/rules/index.js
@@ -9,6 +9,7 @@
// Return a helper with preserved width of cells
var fixHelper = function (e, tr) {
+ "use strict";
var $originals = tr.children();
var $helper = tr.clone();
$helper.children().each(function (index) {
@@ -53,18 +54,17 @@ function sortStop(event, ui) {
var id = trigger.data('id');
var order = i + 1;
entries.push(id);
- //console.log('Entry #' + id + ' will get order ' + order + ' in rule ' + ruleId + '.');
});
if (parent.hasClass('rule-triggers')) {
$.post('rules/rules/trigger/reorder/' + ruleId, {_token: token, triggers: entries}).fail(function () {
- alert('Could not re-order rule triggers. Please refresh the page.')
+ alert('Could not re-order rule triggers. Please refresh the page.');
});
} else {
$.post('rules/rules/action/reorder/' + ruleId, {_token: token, actions: entries}).fail(function () {
- alert('Could not re-order rule actions. Please refresh the page.')
+ alert('Could not re-order rule actions. Please refresh the page.');
});
}
-}
\ No newline at end of file
+}