Skip to content

Commit

Permalink
Be 711 code quality (#62)
Browse files Browse the repository at this point in the history
* BE-711 Code quality config

* skiping some lines of code from coverage

Signed-off-by: nfrunza <nfrunza@gmail.com>

* BE-711 Code quality config

Signed-off-by: nfrunza <nfrunza@gmail.com>

* BE-711 Exclude typescript

Signed-off-by: nfrunza <nfrunza@gmail.com>

* BE-711 Code quality

* added excludes

Signed-off-by: nfrunza <nfrunza@gmail.com>

* BE-711 Code quality excluded files

Signed-off-by: nfrunza <nfrunza@gmail.com>

* BE-711 Update code quality config

Signed-off-by: nfrunza <nfrunza@gmail.com>
  • Loading branch information
nfrunza authored Dec 5, 2019
1 parent db55e92 commit d754835
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 111 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# SPDX-License-Identifier: Apache-2.0
#


explorer_1/scripts/bower_components/
explorer_1/webcontent

node_modules
app/test/coverage/

.idea/*
venv
Expand Down
5 changes: 5 additions & 0 deletions app/platform/fabric/Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ class Platform {
/* eslint-disable */
for (const [network_name, clients] of this.networks.entries()) {
for (const [client_name, client] of clients.entries()) {
console.log(
'initializeListener, client_name, client ',
client_name,
client.client_config
);
if (this.getClient(network_name, client_name).getStatus()) {
const explorerListener = new ExplorerListener(this, syncconfig);
explorerListener.initialize([network_name, client_name, '1']);
Expand Down
2 changes: 1 addition & 1 deletion client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions client/src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ export class App extends Component {
};
}

/* istanbul ignore next */
updateLoadStatus = () => {
this.setState({ loading: false });
};

/* istanbul ignore next */
refreshComponent = mode => {
this.props.changeTheme(mode);
};

/* istanbul ignore next */
render() {
const { auth } = this.props;
const { loading } = this.state;
Expand Down Expand Up @@ -89,6 +92,7 @@ const { changeTheme } = themeActions;
const { errorMessageSelector } = chartSelectors;
const { authSelector } = authSelectors;

/* istanbul ignore next */
export default compose(
withStyles(styles),
connect(
Expand Down
204 changes: 106 additions & 98 deletions client/src/components/Lists/Peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,109 +7,117 @@ import matchSorter from 'match-sorter';
import ReactTable from '../Styled/Table';
import { peerListType } from '../types';

/* istanbul ignore next */
const Peers = ({ peerList }) => {
const columnHeaders = [
{
Header: 'Peer Name',
accessor: 'server_hostname',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['server_hostname'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'Request Url',
accessor: 'requests',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['requests'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'Peer Type',
accessor: 'peer_type',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['peer_type'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'MSPID',
accessor: 'mspid',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['mspid'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'Ledger Height',
columns: [
{
Header: 'High',
accessor: 'ledger_height_high',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_high'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'Low',
accessor: 'ledger_height_low',
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_low'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
{
Header: 'Unsigned',
id: 'ledger_height_unsigned',
accessor: d => d.ledger_height_unsigned.toString(),
filterMethod: (filter, rows) => matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_unsigned'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH },
),
filterAll: true,
},
],
},
];
const columnHeaders = [
{
Header: 'Peer Name',
accessor: 'server_hostname',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['server_hostname'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'Request Url',
accessor: 'requests',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['requests'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'Peer Type',
accessor: 'peer_type',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['peer_type'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'MSPID',
accessor: 'mspid',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['mspid'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'Ledger Height',
columns: [
{
Header: 'High',
accessor: 'ledger_height_high',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_high'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'Low',
accessor: 'ledger_height_low',
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_low'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
},
{
Header: 'Unsigned',
id: 'ledger_height_unsigned',
accessor: d => d.ledger_height_unsigned.toString(),
filterMethod: (filter, rows) =>
matchSorter(
rows,
filter.value,
{ keys: ['ledger_height_unsigned'] },
{ threshold: matchSorter.rankings.SIMPLEMATCH }
),
filterAll: true
}
]
}
];

return (
<div>
<ReactTable
data={peerList}
columns={columnHeaders}
defaultPageSize={5}
filterable
minRows={0}
showPagination={!(peerList.length < 5)}
/>
</div>
);
return (
<div>
<ReactTable
data={peerList}
columns={columnHeaders}
defaultPageSize={5}
filterable
minRows={0}
showPagination={!(peerList.length < 5)}
/>
</div>
);
};

Peers.propTypes = {
peerList: peerListType.isRequired,
peerList: peerListType.isRequired
};

export default Peers;
4 changes: 4 additions & 0 deletions client/src/components/Panels/AdminPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import ChannelForm from '../Forms/ChannelForm';
const styles = theme => {
const { type } = theme.palette;
const dark = type === 'dark';
/* istanbul ignore next */
return {
current: {
color: dark ? 'rgb(42, 173, 230)' : undefined
Expand All @@ -39,6 +40,7 @@ const styles = theme => {
class AdminPanel extends Component {
handleChange = () => {};

/* istanbul ignore next */
render() {
const { classes } = this.props;
return (
Expand Down Expand Up @@ -120,6 +122,7 @@ class AdminPanel extends Component {
}
}

/* istanbul ignore next */
function mapStateToProps(state, ownProps) {
return {
channelList: state.channelList.channelList,
Expand All @@ -130,6 +133,7 @@ function mapStateToProps(state, ownProps) {
// return {actions: bindActionCreators({...partActions,...secActions}, dispatch)}
// }

/* istanbul ignore next */
export default compose(
withStyles(styles),
connect(mapStateToProps /* ,mapDispatchToProps */)
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/Panels/NotificationsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import FontAwesome from 'react-fontawesome';
import { Badge } from 'reactstrap';
import Timeago from 'react-timeago';

/* istanbul ignore next */
const styles = theme => {
const { type } = theme.palette;
const dark = type === 'dark';
Expand Down Expand Up @@ -42,6 +43,7 @@ const styles = theme => {
};

export class NotificationsPanel extends Component {
/* istanbul ignore next */
avatarIcon = (type, classes) => {
switch (type) {
case 'block':
Expand All @@ -59,6 +61,7 @@ export class NotificationsPanel extends Component {
}
};

/* istanbul ignore next */
render() {
const { classes, notifications } = this.props;
if (notifications.length === 0) {
Expand All @@ -77,6 +80,7 @@ export class NotificationsPanel extends Component {
);
}

/* istanbul ignore next */
return (
<div className={classes.panel}>
<div className={classes.root}>
Expand Down
Loading

0 comments on commit d754835

Please sign in to comment.