aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-04-15 09:39:39 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-04-15 09:39:46 +0200
commitd464f2d6abcecd7cd2f5ca6f96d7b61b5b88444b (patch)
treeffe2ae875f3adf9cdef6df315ff4dc898ed8710a /server/sonar-web/src
parent8a49482fc8b942ea75ddab4fee58d75a5c6eee9a (diff)
downloadsonarqube-d464f2d6abcecd7cd2f5ca6f96d7b61b5b88444b.tar.gz
sonarqube-d464f2d6abcecd7cd2f5ca6f96d7b61b5b88444b.zip
fix quality flaws
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/account/store/reducers.js10
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js2
-rw-r--r--server/sonar-web/src/main/js/apps/code/reducers/index.js4
-rw-r--r--server/sonar-web/src/main/js/apps/custom-measures/form-view.js2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/store/reducers.js2
-rw-r--r--server/sonar-web/src/main/js/components/source-viewer/main.js2
6 files changed, 9 insertions, 13 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/store/reducers.js b/server/sonar-web/src/main/js/apps/account/store/reducers.js
index 813dcf15b97..e129a65f17f 100644
--- a/server/sonar-web/src/main/js/apps/account/store/reducers.js
+++ b/server/sonar-web/src/main/js/apps/account/store/reducers.js
@@ -20,9 +20,7 @@
import { RECEIVE_USER, ADD_PROJECT_NOTIFICATIONS, REMOVE_PROJECT_NOTIFICATIONS } from './actions';
function addProjectNotifications (state, project) {
- const found = state.find(notification => {
- return notification.project.internalId === project.internalId;
- });
+ const found = state.find(notification => notification.project.internalId === project.internalId);
if (found) {
return state;
@@ -42,9 +40,7 @@ function addProjectNotifications (state, project) {
}
function removeProjectNotifications (state, project) {
- return state.filter(notification => {
- return notification.project.internalId !== project.internalId;
- });
+ return state.filter(notification => notification.project.internalId !== project.internalId);
}
export const initialState = {
@@ -52,7 +48,7 @@ export const initialState = {
projectNotifications: window.sonarqube.notifications.project
};
-export default function (state = initialState, action) {
+export default function (state = initialState, action = {}) {
switch (action.type) {
case RECEIVE_USER:
return {
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
index 44cb08af7fd..82ada158894 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
@@ -47,7 +47,7 @@ function updateTask (tasks, newTask) {
return tasks.map(task => task.id === newTask.id ? newTask : task);
}
-export default function (state = initialState, action) {
+export default function (state = initialState, action = {}) {
switch (action.type) {
case INIT:
return {
diff --git a/server/sonar-web/src/main/js/apps/code/reducers/index.js b/server/sonar-web/src/main/js/apps/code/reducers/index.js
index f061926e0e4..a554d94d26d 100644
--- a/server/sonar-web/src/main/js/apps/code/reducers/index.js
+++ b/server/sonar-web/src/main/js/apps/code/reducers/index.js
@@ -112,7 +112,7 @@ export const initialState = {
errorMessage: null
};
-export function current (state = initialState, action) {
+export function current (state = initialState, action = {}) {
/* eslint no-case-declarations: 0 */
/* FIXME fix it ^^^ */
switch (action.type) {
@@ -183,7 +183,7 @@ export function current (state = initialState, action) {
}
}
-export function bucket (state = [], action) {
+export function bucket (state = [], action = {}) {
switch (action.type) {
case INIT:
return merge(state, action.component);
diff --git a/server/sonar-web/src/main/js/apps/custom-measures/form-view.js b/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
index 857c4594ece..c25c9470ef1 100644
--- a/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
+++ b/server/sonar-web/src/main/js/apps/custom-measures/form-view.js
@@ -62,7 +62,7 @@ export default ModalForm.extend({
const isNew = !this.model;
return _.extend(ModalForm.prototype.serializeData.apply(this, arguments), {
metrics,
- canCreateMetric: !isNew || (isNew && metrics.length > 0)
+ canCreateMetric: !isNew || metrics.length > 0
});
}
});
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/store/reducers.js b/server/sonar-web/src/main/js/apps/quality-gates/store/reducers.js
index aadba7a2415..0b8e06d0656 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/store/reducers.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/store/reducers.js
@@ -34,7 +34,7 @@ import { checkIfDefault, addCondition, deleteCondition, replaceCondition } from
const initialState = {};
-export default function rootReducer (state = initialState, action) {
+export default function rootReducer (state = initialState, action = {}) {
switch (action.type) {
case SET_STATE:
return { ...state, ...action.nextState };
diff --git a/server/sonar-web/src/main/js/components/source-viewer/main.js b/server/sonar-web/src/main/js/components/source-viewer/main.js
index 26add5f014b..f1d4e9619e0 100644
--- a/server/sonar-web/src/main/js/components/source-viewer/main.js
+++ b/server/sonar-web/src/main/js/components/source-viewer/main.js
@@ -472,7 +472,7 @@ export default Marionette.LayoutView.extend({
const outOfBounds = b.from > line || b.from + b.size < line;
const currentFile = b._ref === '1';
const shouldDisplayForCurrentFile = outOfBounds || foundOne;
- const shouldDisplay = !currentFile || (currentFile && shouldDisplayForCurrentFile);
+ const shouldDisplay = !currentFile || shouldDisplayForCurrentFile;
const isOk = (b._ref != null) && shouldDisplay;
if (b._ref === '1' && !outOfBounds) {
foundOne = true;