RubyLouvre/anu

View on GitHub

Showing 594 of 880 total issues

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    if (__DEV__) {
      expect(Object.isFrozen(element)).toBe(true);
      expect(Object.isFrozen(element.props)).toBe(true);
    }
Severity: Major
Found in packages/core/__tests__/ReactElementClone-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

    if (__DEV__) {
      expect(Object.isFrozen(element)).toBe(true);
      expect(Object.isFrozen(element.props)).toBe(true);
    }
Severity: Major
Found in packages/core/__tests__/ReactElementClone-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 125..128
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        if (__DEV__) {
            expect(Object.isFrozen(element)).toBe(true);
            expect(Object.isFrozen(element.props)).toBe(true);
        }
Severity: Major
Found in packages/core/__tests__/ReactElement-test.js and 7 other locations - About 1 hr to fix
packages/core/__tests__/ReactElement-test.js on lines 53..56
packages/core/__tests__/ReactElement-test.js on lines 164..167
packages/core/__tests__/ReactElement-test.js on lines 180..183
packages/core/__tests__/ReactElement-test.js on lines 197..200
packages/core/__tests__/ReactElement-test.js on lines 219..222
packages/core/__tests__/ReactElementClone-test.js on lines 325..328
packages/core/__tests__/ReactElementClone-test.js on lines 347..350

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function extend(obj, props) {
    for (let i in props) {
        if (hasOwnProperty.call(props, i)) {
            obj[i] = props[i];
        }
Severity: Major
Found in packages/core/util.js and 1 other location - About 1 hr to fix
lib/createClass.js on lines 33..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    expect(() => ReactDOM.render(<AllLegacyLifecycles />, container)).toWarnDev(
      'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
        'AllLegacyLifecycles uses getSnapshotBeforeUpdate() but also contains the following legacy lifecycles:\n' +
        '  componentWillMount\n' +
        '  UNSAFE_componentWillReceiveProps\n' +
packages/render/dom/__tests__/ReactComponentLifeCycle-test.js on lines 730..738

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      class Parent extends React.Component {
        render() {
          return (
            <div>
              <WrapperComponent>{this.props.children}</WrapperComponent>
Severity: Major
Found in packages/render/dom/__tests__/ReactMultiChild-test.js and 1 other location - About 1 hr to fix
packages/render/dom/__tests__/ReactMultiChild-test.js on lines 230..238

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      class Parent extends React.Component {
        render() {
          return (
            <div>
              <WrapperComponent>{this.props.children}</WrapperComponent>
Severity: Major
Found in packages/render/dom/__tests__/ReactMultiChild-test.js and 1 other location - About 1 hr to fix
packages/render/dom/__tests__/ReactMultiChild-test.js on lines 191..199

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function extend(obj, props) {
    for (var i in props) {
        if (hasOwnProperty.call(props, i)) {
            obj[i] = props[i];
        }
Severity: Major
Found in lib/createClass.js and 1 other location - About 1 hr to fix
packages/core/util.js on lines 76..83

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    expect(() => ReactDOM.render(<AllLegacyLifecycles />, container)).toWarnDev(
      'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
        'AllLegacyLifecycles uses getDerivedStateFromProps() but also contains the following legacy lifecycles:\n' +
        '  componentWillMount\n' +
        '  UNSAFE_componentWillReceiveProps\n' +
packages/render/dom/__tests__/ReactComponentLifeCycle-test.js on lines 815..823

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 57.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

CanvasContext.prototype.setTextAlign = function(align) {
    this.missions.push(() => {
        this.ctx.textAlign = align;
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 20..24
packages/render/miniapp/apiForH5/canvas.js on lines 60..64
packages/render/miniapp/apiForH5/canvas.js on lines 66..70
packages/render/miniapp/apiForH5/canvas.js on lines 72..76
packages/render/miniapp/apiForH5/canvas.js on lines 78..82
packages/render/miniapp/apiForH5/canvas.js on lines 193..197
packages/render/miniapp/apiForH5/canvas.js on lines 231..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    expect(() => {
      const instance = ReactTestUtils.renderIntoDocument(element);
      expect(instance._isMounted()).toBeTruthy();
    }).toWarnDev('Component is accessing isMounted inside its render()');
packages/render/dom/__tests__/ReactComponentLifeCycle-test.js on lines 227..230

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

CanvasContext.prototype.setTextBaseline = function(textBaseline) {
    this.missions.push(() => {
        this.ctx.textBaseline = textBaseline;
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 14..18
packages/render/miniapp/apiForH5/canvas.js on lines 60..64
packages/render/miniapp/apiForH5/canvas.js on lines 66..70
packages/render/miniapp/apiForH5/canvas.js on lines 72..76
packages/render/miniapp/apiForH5/canvas.js on lines 78..82
packages/render/miniapp/apiForH5/canvas.js on lines 193..197
packages/render/miniapp/apiForH5/canvas.js on lines 231..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

CanvasContext.prototype.setLineWidth = function(lineWidth) {
    this.missions.push(() => {
        this.ctx.lineWidth = lineWidth;
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 14..18
packages/render/miniapp/apiForH5/canvas.js on lines 20..24
packages/render/miniapp/apiForH5/canvas.js on lines 66..70
packages/render/miniapp/apiForH5/canvas.js on lines 72..76
packages/render/miniapp/apiForH5/canvas.js on lines 78..82
packages/render/miniapp/apiForH5/canvas.js on lines 193..197
packages/render/miniapp/apiForH5/canvas.js on lines 231..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

CanvasContext.prototype.setLineCap = function(lineCap) {
    this.missions.push(() => {
        this.ctx.lineCap = lineCap;
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 14..18
packages/render/miniapp/apiForH5/canvas.js on lines 20..24
packages/render/miniapp/apiForH5/canvas.js on lines 60..64
packages/render/miniapp/apiForH5/canvas.js on lines 72..76
packages/render/miniapp/apiForH5/canvas.js on lines 78..82
packages/render/miniapp/apiForH5/canvas.js on lines 193..197
packages/render/miniapp/apiForH5/canvas.js on lines 231..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

CanvasContext.prototype.setMiterLimit = function(miterLimit) {
    this.missions.push(() => {
        this.ctx.miterLimit = miterLimit;
    });
};
Severity: Major
Found in packages/render/miniapp/apiForH5/canvas.js and 7 other locations - About 1 hr to fix
packages/render/miniapp/apiForH5/canvas.js on lines 14..18
packages/render/miniapp/apiForH5/canvas.js on lines 20..24
packages/render/miniapp/apiForH5/canvas.js on lines 60..64
packages/render/miniapp/apiForH5/canvas.js on lines 66..70
packages/render/miniapp/apiForH5/canvas.js on lines 72..76
packages/render/miniapp/apiForH5/canvas.js on lines 193..197
packages/render/miniapp/apiForH5/canvas.js on lines 231..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language