exoRift/react-fluent-mobile

View on GitHub

Showing 22 of 22 total issues

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

    if (this.collapsed && this._registeredStart.some((v, i) => v !== this._registeredEnd![i])) {
      if (this.reversed) super.setEnd(...this._registeredEnd)
      else super.setStart(...this._registeredEnd)

      this.reversed = !this.reversed
Severity: Major
Found in src/util/flexible-range.ts and 1 other location - About 3 hrs to fix
src/util/flexible-range.ts on lines 79..84

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

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

    if (this.collapsed && this._registeredEnd.some((v, i) => v !== this._registeredStart![i])) {
      if (this.reversed) super.setStart(...this._registeredStart)
      else super.setEnd(...this._registeredStart)

      this.reversed = !this.reversed
Severity: Major
Found in src/util/flexible-range.ts and 1 other location - About 3 hrs to fix
src/util/flexible-range.ts on lines 54..59

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

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

      if (navigator.clipboard?.writeText) void navigator.clipboard.writeText(element.src)
      else {
        const selection = window.getSelection()

        const tempElement = document.createElement('span')
Severity: Major
Found in src/util/menu-options.tsx and 1 other location - About 3 hrs to fix
src/util/menu-options.tsx on lines 55..68

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

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

      if (navigator.clipboard?.writeText) void navigator.clipboard.writeText(anchor?.href ?? '')
      else {
        const selection = window.getSelection()

        const tempElement = document.createElement('span')
Severity: Major
Found in src/util/menu-options.tsx and 1 other location - About 3 hrs to fix
src/util/menu-options.tsx on lines 163..176

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

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>add_photo_alternate</div>

        <span className='tag'>Open image in new tab</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>ios_share</div>

        <span className='tag'>Share Image</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>media_link</div>

        <span className='tag'>Copy image address</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>add_box</div>

        <span className='tag'>Open link in new tab</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>system_update_alt</div>

        <span className='tag'>Download image</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>photo_library</div>

        <span className='tag'>Copy image</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>link</div>

        <span className='tag'>Copy link address</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>format_size</div>

        <span className='tag'>Copy link text</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>download</div>

        <span className='tag'>Download link file</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 113..119
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    Component: (
      <div className='fluent menuoption'>
        <div className='material-symbols-outlined icon'>share</div>

        <span className='tag'>Share Link</span>
Severity: Major
Found in src/util/menu-options.tsx and 9 other locations - About 1 hr to fix
src/util/menu-options.tsx on lines 26..32
src/util/menu-options.tsx on lines 45..51
src/util/menu-options.tsx on lines 72..78
src/util/menu-options.tsx on lines 92..98
src/util/menu-options.tsx on lines 131..137
src/util/menu-options.tsx on lines 141..147
src/util/menu-options.tsx on lines 155..161
src/util/menu-options.tsx on lines 180..186
src/util/menu-options.tsx on lines 199..205

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

    if (touches[1]) this.selectRange.setStart(...SelectionMixin.getCaretPosition(positions[0], positions[1] + (this.originRange.startCoords.height / 2)))
Severity: Major
Found in src/components/SelectionMixin.tsx and 1 other location - About 1 hr to fix
src/components/SelectionMixin.tsx on lines 284..284

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

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

    if (touches[0]) this.selectRange.setEnd(...SelectionMixin.getCaretPosition(positions[2], positions[3] + (this.originRange.endCoords.height / 2)))
Severity: Major
Found in src/components/SelectionMixin.tsx and 1 other location - About 1 hr to fix
src/components/SelectionMixin.tsx on lines 283..283

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

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

    else if (rect.right > window.innerWidth) body.style.marginLeft = `${window.innerWidth - rect.right}px`
Severity: Minor
Found in src/components/ContextMixin.tsx and 1 other location - About 50 mins to fix
src/components/ContextMixin.tsx on lines 308..308

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

    if (rect.bottom > window.innerHeight) body.style.marginTop = `${window.innerHeight - rect.bottom}px`
Severity: Minor
Found in src/components/ContextMixin.tsx and 1 other location - About 50 mins to fix
src/components/ContextMixin.tsx on lines 306..306

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

      touches[0] && TouchHandler.originTouches[0] ? touches[0].clientX - TouchHandler.originTouches[0].clientX : 0, // End X
Severity: Minor
Found in src/components/SelectionMixin.tsx and 1 other location - About 40 mins to fix
src/components/SelectionMixin.tsx on lines 273..273

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

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

      touches[1] && TouchHandler.originTouches[1] ? touches[1].clientY - TouchHandler.originTouches[1].clientY : 0, // Start Y
Severity: Minor
Found in src/components/SelectionMixin.tsx and 1 other location - About 40 mins to fix
src/components/SelectionMixin.tsx on lines 274..274

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

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