RubyLouvre/anu

View on GitHub

Showing 594 of 880 total issues

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

    class Grandparent extends React.Component {
      render() {
        return (
          <Parent ref="parent">
            <span key="abc" />
Severity: Major
Found in packages/core/__tests__/ReactElementClone-test.js and 2 other locations - About 50 mins to fix
packages/core/__tests__/ReactElementClone-test.js on lines 201..209
packages/render/dom/__tests__/ReactCompositeComponent-test.js on lines 762..770

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 52.

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 3 locations. Consider refactoring.
Open

        ReactDOM.render(
            <ErrorBoundary>
                <Normal />
                <Normal logName="Normal2" />
                <BrokenComponentWillMount />
packages/render/dom/__tests__/ReactErrorBoundaries-test.internal.js on lines 1010..1017
packages/render/dom/__tests__/ReactErrorBoundaries-test.internal.js on lines 1196..1203

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 52.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

            var callback = jasmine.createSpy().and.callFake(function (kid, index) {
                expect(this).toBe(context);
                return kid;
            });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 177..180
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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 9 locations. Consider refactoring.
Open

        var callback = jasmine.createSpy().and.callFake(function (kid, index) {
            expect(this).toBe(context);
            return kid;
        });
Severity: Major
Found in packages/core/__tests__/ReactChildren-test.js and 8 other locations - About 50 mins to fix
packages/core/__tests__/ReactChildren-test.js on lines 55..58
packages/core/__tests__/ReactChildren-test.js on lines 78..81
packages/core/__tests__/ReactChildren-test.js on lines 126..129
packages/core/__tests__/ReactChildren-test.js on lines 207..210
packages/core/__tests__/ReactChildren-test.js on lines 250..253
packages/core/__tests__/ReactChildren-test.js on lines 292..295
packages/core/__tests__/ReactChildren-test.js on lines 332..335
packages/core/__tests__/ReactChildren-test.js on lines 370..373

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 51.

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

    ReactDOM.render(
      <Wrapper key="wrap1">
        <span ref={c => (node1 = c)} />
      </Wrapper>,
      container,
Severity: Minor
Found in packages/render/dom/__tests__/ReactIdentity-test.js and 1 other location - About 50 mins to fix
packages/render/dom/__tests__/ReactIdentity-test.js on lines 47..52

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 51.

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

    ReactDOM.render(
      <Wrapper key="wrap2">
        <span ref={c => (node2 = c)} />
      </Wrapper>,
      container,
Severity: Minor
Found in packages/render/dom/__tests__/ReactIdentity-test.js and 1 other location - About 50 mins to fix
packages/render/dom/__tests__/ReactIdentity-test.js on lines 41..46

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 51.

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

  async function serverRender(reactElement, errorCount = 0) {
    const markup = await renderIntoString(reactElement, errorCount);
    const domElement = document.createElement('div');
    domElement.innerHTML = markup;
    return domElement.firstChild;
packages/render/server/__tests2__/utils/ReactDOMServerIntegrationTestUtils.js on lines 125..130

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 51.

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

  async function streamRender(reactElement, errorCount = 0) {
    const markup = await renderIntoStream(reactElement, errorCount);
    const domElement = document.createElement('div');
    domElement.innerHTML = markup;
    return domElement.firstChild;
packages/render/server/__tests2__/utils/ReactDOMServerIntegrationTestUtils.js on lines 89..94

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 51.

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 5 locations. Consider refactoring.
Open

function clearStorage({
    success = () => {},
    fail = () => {},
    complete = () => {}
} = {}) {
Severity: Major
Found in packages/render/miniapp/apiForH5/storage.js and 4 other locations - About 45 mins to fix
packages/render/miniapp/apiForH5/systemInfo.js on lines 4..40
packages/render/miniapp/apiForH5/vibrate.js on lines 5..18
packages/render/miniapp/apiForH5/vibrate.js on lines 23..36
packages/render/miniapp/apiForH5/ws.js on lines 97..108

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 50.

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 5 locations. Consider refactoring.
Open

function vibrateLong({ 
  success = () => {},
  fail = () => {},
  complete = () => {}
} = {}) {
Severity: Major
Found in packages/render/miniapp/apiForH5/vibrate.js and 4 other locations - About 45 mins to fix
packages/render/miniapp/apiForH5/storage.js on lines 124..137
packages/render/miniapp/apiForH5/systemInfo.js on lines 4..40
packages/render/miniapp/apiForH5/vibrate.js on lines 23..36
packages/render/miniapp/apiForH5/ws.js on lines 97..108

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 50.

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 5 locations. Consider refactoring.
Open

function getSystemInfo({
    success = () => {},
    fail = () => {},
    complete = () => {}
} = {}) {
Severity: Major
Found in packages/render/miniapp/apiForH5/systemInfo.js and 4 other locations - About 45 mins to fix
packages/render/miniapp/apiForH5/storage.js on lines 124..137
packages/render/miniapp/apiForH5/vibrate.js on lines 5..18
packages/render/miniapp/apiForH5/vibrate.js on lines 23..36
packages/render/miniapp/apiForH5/ws.js on lines 97..108

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 50.

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 5 locations. Consider refactoring.
Open

function closeSocket({
    success = () => {},
    fail = () => {},
    complete = () => {}
} = {}) {
Severity: Major
Found in packages/render/miniapp/apiForH5/ws.js and 4 other locations - About 45 mins to fix
packages/render/miniapp/apiForH5/storage.js on lines 124..137
packages/render/miniapp/apiForH5/systemInfo.js on lines 4..40
packages/render/miniapp/apiForH5/vibrate.js on lines 5..18
packages/render/miniapp/apiForH5/vibrate.js on lines 23..36

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 50.

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 5 locations. Consider refactoring.
Open

function vibrateShort({ 
  success = () => {},
  fail = () => {},
  complete = () => {}
} = {}) {
Severity: Major
Found in packages/render/miniapp/apiForH5/vibrate.js and 4 other locations - About 45 mins to fix
packages/render/miniapp/apiForH5/storage.js on lines 124..137
packages/render/miniapp/apiForH5/systemInfo.js on lines 4..40
packages/render/miniapp/apiForH5/vibrate.js on lines 5..18
packages/render/miniapp/apiForH5/ws.js on lines 97..108

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 50.

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