Similar blocks of code found in 2 locations. Consider refactoring.
<div style={{ height: '50px' }}>
<div style={{ width: '50%', float: 'left' }}>
{this.state.val}
</div>
<div style={{ width: '50%', float: 'left' }}>
Similar blocks of code found in 2 locations. Consider refactoring.
<div style={{ height: '50px' }}>
<div style={{ width: '50%', float: 'left' }}>
{this.state.val}
</div>
<div style={{ width: '50%', float: 'left' }}>
Similar blocks of code found in 5 locations. Consider refactoring.
it('treat , like .', (done) => {
const props = {
value: '215',
};
props[key] = (value) => {
Similar blocks of code found in 5 locations. Consider refactoring.
it('when called on children transmit it to parent with value multiplied by 100', (done) => {
const props = {
value: '215',
};
props[key] = (value) => {
Similar blocks of code found in 5 locations. Consider refactoring.
it('refuses more than 2 decimals', (done) => {
const props = {
value: '215',
};
props[key] = (value) => {
Similar blocks of code found in 5 locations. Consider refactoring.
it('escape non digit chars', (done) => {
const props = {
value: '215',
};
props[key] = (value) => {
Similar blocks of code found in 5 locations. Consider refactoring.
it('works with input type="text"', (done) => {
const props = {
value: '215',
};
props[key] = (value) => {
Similar blocks of code found in 2 locations. Consider refactoring.
it('accept number value', () => {
const wrapper = shallow(
<ReactAmountField className="bar" value={1337}><span /></ReactAmountField>,
);
expect(wrapper.html()).to.equal('<div><span class="bar" value="13.37"></span></div>');
Similar blocks of code found in 2 locations. Consider refactoring.
it('handle value equals to 0 (integer)', () => {
const wrapper = shallow(
<ReactAmountField className="bar" value={0}><span /></ReactAmountField>,
);
expect(wrapper.html()).to.equal('<div><span class="bar" value="0"></span></div>');
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring.
export const ExampleForm = function render(props) {
const {
handleSubmit,
resolvedValue,
resolvedVisited,
Identical blocks of code found in 2 locations. Consider refactoring.
beforeEach(() => {
const stub = sinon.stub(console, 'error');
stub.callsFake((warning) => { throw new Error(warning); });
});
src/__tests__/ReduxFormMaterialUiWrapper.test.jsx on lines 22..25 Identical blocks of code found in 2 locations. Consider refactoring.
beforeEach(() => {
const stub = sinon.stub(console, 'error');
stub.callsFake((warning) => { throw new Error(warning); });
});
Function mapStateToProps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
function mapStateToProps(state) {
let resolvedValue = null;
let resolvedVisited = false;
let resolvedTouched = false;
let resolvedActive = false;
Similar blocks of code found in 3 locations. Consider refactoring.
module.hot.accept('./ReduxFormExample', () => {
ReactDOM.render(
<AppContainer>
Similar blocks of code found in 3 locations. Consider refactoring.
module.hot.accept('./Example2', () => {
ReactDOM.render(
<AppContainer>
Similar blocks of code found in 3 locations. Consider refactoring.
module.hot.accept('./Example1', () => {
ReactDOM.render(
<AppContainer>
Similar blocks of code found in 3 locations. Consider refactoring.
if (form.reduxForm.fields.field.visited) {
resolvedVisited = form.reduxForm.fields.field.visited;
}
Similar blocks of code found in 3 locations. Consider refactoring.
if (form.reduxForm.fields.field.touched) {
resolvedTouched = form.reduxForm.fields.field.touched;
}
Similar blocks of code found in 3 locations. Consider refactoring.
if (form.reduxForm.fields.field.active) {
resolvedActive = form.reduxForm.fields.field.active;
}