Skip to content

Commit

Permalink
BE-835 Fixed sonarcloud code smell issues (#194)
Browse files Browse the repository at this point in the history
Signed-off-by: jeeva <jeevasang@gmail.com>
  • Loading branch information
JeevaSang authored Oct 7, 2020
1 parent 72c0997 commit 5f70976
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/rest/authroutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ export async function authroutes(router: any, platform: any) {
req.logout();
res.send();
});
};
}
24 changes: 12 additions & 12 deletions client/src/state/redux/charts/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import types from './types';
/* Reducers for Dashboard Charts */
const initialState = {};

const blockPerHourReducer = (state = initialState, action) => {
const blockPerHourReducer = (state = initialState, action = {}) => {
if (action.type === types.BLOCK_CHART_HOUR) {
return {
rows: action.payload.blockPerHour.rows,
Expand All @@ -19,7 +19,7 @@ const blockPerHourReducer = (state = initialState, action) => {
return state;
}
};
const errorMessageReducer = (state = initialState, action) => {
const errorMessageReducer = (state = initialState, action = {}) => {
if (action.type === types.ERROR_MESSAGE) {
return {
error: action.payload,
Expand All @@ -29,7 +29,7 @@ const errorMessageReducer = (state = initialState, action) => {
}
};

const blockPerMinReducer = (state = initialState, action) => {
const blockPerMinReducer = (state = initialState, action = {}) => {
if (action.type === types.BLOCK_CHART_MIN) {
return {
rows: action.payload.blockPerMin.rows,
Expand All @@ -41,7 +41,7 @@ const blockPerMinReducer = (state = initialState, action) => {
}
};

const channelListReducer = (state = initialState, action) => {
const channelListReducer = (state = initialState, action = {}) => {
if (action.type === types.CHANNEL_LIST) {
return {
list: action.payload.channels,
Expand All @@ -53,22 +53,22 @@ const channelListReducer = (state = initialState, action) => {
}
};

const channelReducer = (state = initialState, action) => {
const channelReducer = (state = initialState, action = {}) => {
if (action.type === types.CHANNEL || action.type === types.CHANGE_CHANNEL) {
return action.payload.channel;
} else {
return state;
}
};

const dashStatsReducer = (state = initialState, action) => {
const dashStatsReducer = (state = initialState, action = {}) => {
if (action.type === types.DASHBOARD_STATS) {
return action.payload;
} else {
return state;
}
};
const blockActivityReducer = (state = initialState, action) => {
const blockActivityReducer = (state = initialState, action = {}) => {
if (action.type === types.BLOCK_ACTIVITY) {
return {
rows: action.payload.row,
Expand All @@ -79,15 +79,15 @@ const blockActivityReducer = (state = initialState, action) => {
return state;
}
};
const notificationReducer = (state = initialState, action) => {
const notificationReducer = (state = initialState, action = {}) => {
if (action.type === types.NOTIFICATION_LOAD) {
return action.payload.notification;
} else {
return state;
}
};

const peerStatusReducer = (state = initialState, action) => {
const peerStatusReducer = (state = initialState, action = {}) => {
if (action.type === types.PEER_STATUS) {
return {
list: action.payload.peers,
Expand All @@ -99,7 +99,7 @@ const peerStatusReducer = (state = initialState, action) => {
}
};

const transactionByOrgReducer = (state = initialState, action) => {
const transactionByOrgReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION_CHART_ORG) {
return {
rows: action.payload.rows,
Expand All @@ -111,7 +111,7 @@ const transactionByOrgReducer = (state = initialState, action) => {
}
};

const transactionPerHourReducer = (state = initialState, action) => {
const transactionPerHourReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION_CHART_HOUR) {
return {
rows: action.payload.transactionPerHour.rows,
Expand All @@ -123,7 +123,7 @@ const transactionPerHourReducer = (state = initialState, action) => {
}
};

const transactionPerMinReducer = (state = initialState, action) => {
const transactionPerMinReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION_CHART_MIN) {
return {
rows: action.payload.transactionPerMin.rows,
Expand Down
16 changes: 8 additions & 8 deletions client/src/state/redux/tables/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import types from './types';

const initialState = {};

const blockListReducer = (state = initialState, action) => {
const blockListReducer = (state = initialState, action = {}) => {
if (action.type === types.BLOCK_LIST) {
return {
rows: action.payload.rows,
Expand All @@ -19,7 +19,7 @@ const blockListReducer = (state = initialState, action) => {
}
};

const blockListSearchReducer = (state = initialState, action) => {
const blockListSearchReducer = (state = initialState, action = {}) => {
if (action.type === types.BLOCK_LIST_SEARCH) {
return {
rows: action.payload.rows,
Expand All @@ -31,7 +31,7 @@ const blockListSearchReducer = (state = initialState, action) => {
}
};

const chaincodeListReducer = (state = initialState, action) => {
const chaincodeListReducer = (state = initialState, action = {}) => {
if (action.type === types.CHAINCODE_LIST) {
return {
rows: action.payload.chaincode,
Expand All @@ -43,7 +43,7 @@ const chaincodeListReducer = (state = initialState, action) => {
}
};

const channelsReducer = (state = initialState, action) => {
const channelsReducer = (state = initialState, action = {}) => {
if (action.type === types.CHANNELS) {
return {
rows: action.payload.channels,
Expand All @@ -56,7 +56,7 @@ const channelsReducer = (state = initialState, action) => {

};

const peerListReducer = (state = initialState, action) => {
const peerListReducer = (state = initialState, action = {}) => {
if (action.type === types.PEER_LIST) {
return {
rows: action.payload.peers,
Expand All @@ -68,7 +68,7 @@ const peerListReducer = (state = initialState, action) => {
}
};

const transactionReducer = (state = initialState, action) => {
const transactionReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION) {
return {
transaction: action.payload.row,
Expand All @@ -80,7 +80,7 @@ const transactionReducer = (state = initialState, action) => {
}
};

const transactionListReducer = (state = initialState, action) => {
const transactionListReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION_LIST) {
return {
rows: action.payload.rows,
Expand All @@ -92,7 +92,7 @@ const transactionListReducer = (state = initialState, action) => {
}
};

const transactionListSearchReducer = (state = initialState, action) => {
const transactionListSearchReducer = (state = initialState, action = {}) => {
if (action.type === types.TRANSACTION_LIST_SEARCH) {
return {
rows: action.payload.rows,
Expand Down
2 changes: 1 addition & 1 deletion client/src/state/redux/theme/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import types from './types';

/* Reducers for Dashboard Charts */
const themeReducer = (state = { mode: 'light' }, action) => {
const themeReducer = (state = { mode: 'light' }, action = {}) => {
if (action.type === types.CHANGE_THEME) {
return {
...state,
Expand Down

0 comments on commit 5f70976

Please sign in to comment.