Final#48
Conversation
|
Issues
======
+ Solved 1
- Added 478
Complexity increasing per file
==============================
- src/views/Order/Summary.js 1
- src/views/Pages/Login/Login.js 6
- src/views/Order/Address.js 1
- src/views/Map/CustomerMap.js 4
- src/components/Screens/Orders/index.js 1
- src/containers/DefaultLayout/DefaultHeader.js 1
- src/containers/DefaultLayout/__tests__/DefaultLayout.test.js 1
- src/store/actions/community.js 1
- src/views/Order/index.js 1
- src/store/reducers/community.js 4
- src/views/Pages/Register/Register.js 7
- src/views/Community/View.js 9
- src/views/Pages/Accout/index.js 1
- src/views/Pages/Message/RegMessage.js 3
- src/routes.js 1
- src/views/Community/Editor.js 12
- src/containers/DefaultLayout/DefaultLayout.js 4
- src/views/Community/index.js 7
- src/views/History/index.js 1
- src/containers/DefaultLayout/__tests__/DefaultHeader.test.js 1
- src/components/Payment/index.js 4
- src/store/reducers/user.js 2
- src/containers/DefaultLayout/DefaultFooter.js 1
- src/views/Pages/Register/Register.test.js 1
- src/views/Map/AgentMAp.js 3
See the complete overview on Codacy |
| let google = window.google; | ||
| let addRoute = this.addRoute; | ||
| const handleLocationError = this.handleLocationError; | ||
| let processSVData = this.processSVData; |
There was a problem hiding this comment.
| let { loading, error, errorMessage, userData } = this.props.userData; | ||
| error === 'true' && errorMessage !== '' ? (f = errorMessage) : | ||
| (userData.errorcount !== '0' ? (f = userData.error) : (f = '')); | ||
| loading === 'done' ? (u = 'Login') : |
| let val = e.target.value.replace(/\D/g, ''); | ||
| switch (e.target.id) { | ||
| case 'cardNumber': | ||
| let addSpace = val.replace(/(.{4})/g, '$1 ').trim(); |
There was a problem hiding this comment.
Issue found: Unexpected lexical declaration in case block.
| panorama.setVisible(true); | ||
|
|
||
| marker.addListener('click', () => { | ||
| let markerPanoID = data.location.pano; |
There was a problem hiding this comment.
| const mapStateToProps = (state) => { | ||
| return { | ||
| communityData: state.communityData | ||
| } |
| const mapStateToProps = (state) => { | ||
| return { | ||
| communityData: state.communityData | ||
| } |
| import React, { Component } from 'react'; | ||
| import { | ||
| Button, Card, CardBody, Col, Container, Form, Input, InputGroup | ||
| , InputGroupAddon, InputGroupText, Row, Nav, NavItem, NavLink, TabContent, TabPane |
| } | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Issue found: More than 1 blank line not allowed.
| }); | ||
| } | ||
|
|
||
| render() { |
There was a problem hiding this comment.
Issue found: Expected 'this' to be used by class method 'render'.
| @@ -0,0 +1,123 @@ | |||
| import React, { Component } from 'react' | |||
| import { | |||
| Button, | |||
There was a problem hiding this comment.
Issue found: 'Button' is defined but never used.
| dispatch(fetchCommunityDataFailure(errorMessage)) | ||
| }) | ||
|
|
||
| } catch (error) { |
There was a problem hiding this comment.
Issue found: Block must not be padded by blank lines.
| let bounds = new google.maps.LatLngBounds(); | ||
| places.forEach((place) => { | ||
| if (!place.geometry) { | ||
| console.log("Returned place contains no geometry"); |
|
|
||
| render() { | ||
| const mystyle = { | ||
| backgroundColor: "white", |
| import { Col, Container, Row } from 'reactstrap'; | ||
| import { withRouter } from 'react-router-dom'; | ||
|
|
||
|
|
There was a problem hiding this comment.
Issue found: More than 1 blank line not allowed.
| import { sendCommunityData } from '../../store/actions/community'; | ||
| import Payment from '../../components/Payment'; | ||
| import { isAuthUserType } from '../../services/Auth'; | ||
| import { Link } from 'react-router-dom'; |
There was a problem hiding this comment.
Issue found: 'Link' is defined but never used.
| } | ||
|
|
||
| componentDidUpdate(prevProps) { | ||
| let { userData } = this.props.userData; |
There was a problem hiding this comment.
Issue found: 'userData' is never reassigned. Use 'const' instead.
| infoWindow.open(map); | ||
| } | ||
|
|
||
| render() { |
There was a problem hiding this comment.
Issue found: Expected 'this' to be used by class method 'render'.
|
|
||
| render() { | ||
| let { searchBox, addressBox } = this.state | ||
| console.log(addressBox) |
| @@ -0,0 +1,26 @@ | |||
| import React, { Component } from 'react'; | |||
| import PropTypes from 'prop-types'; | |||
There was a problem hiding this comment.
| markers = []; | ||
|
|
||
| // For each place, get the icon, name and location. | ||
| let bounds = new google.maps.LatLngBounds(); |
There was a problem hiding this comment.
Issue found: 'bounds' is never reassigned. Use 'const' instead.
|
|
||
| handleLocationError(browserHasGeolocation, infoWindow, pos) { | ||
| infoWindow.setPosition(pos); | ||
| infoWindow.setContent(browserHasGeolocation ? |
There was a problem hiding this comment.
Issue found: '?' should be placed at the beginning of the line.
| if ((data.file_name === imagePreviewUrl) && (data.location === location) && (data.amount === amount) && (data.details === details)) { | ||
| this.clsBtn.current.style.display = "block"; | ||
| return null | ||
| } else { |
There was a problem hiding this comment.
Issue found: Unnecessary 'else' after 'return'.
| if (userData.status === 'successful' && userData.errorcount === '0') { | ||
| authenticateUser(userData.email, 'customer') | ||
| this.props.history.push('/order') | ||
| }; |
| return ( | ||
| <div className="app"> | ||
| <AppHeader fixed> | ||
| <DefaultHeader onLogout={e => this.signOut(e)} /> |
There was a problem hiding this comment.
Issue found: Expected parentheses around arrow function argument.
| { path: '/order', exact: true, name: 'Order', component: Order }, | ||
| { path: '/account', exact: true, name: 'Account', component: Account }, | ||
| { path: '/community', exact: true, name: 'Community', component: Community }, | ||
| { path: '/history', exact: true, name: 'History', component: History }, |
There was a problem hiding this comment.
Issue found: Expected a line break after this opening brace.
Description
Please include a summary of the change and relevant motivation and context.
List any dependencies that are required for this change.
All pull requests should be related to open issues. Indicate the issue(s) bellow and remove this line:
Fixes #(issue number 1) #(issue number 2 if applicable)
How Has This Been Tested?
Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code etc.
Screenshots (if applicable, else remove this line / section)
Checklist: