kabisa/kudos-frontend

View on GitHub
src/support/breakpoints.tsx

Summary

Maintainability
C
1 day
Test Coverage
F
52%

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

const Mobile = ({ children }: { children: ReactNode }) => {
  const isMobile = useMediaQuery({ minWidth: 320, maxWidth: 767 });
  return isMobile ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 1 other location - About 1 hr to fix
src/support/breakpoints.tsx on lines 14..17

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

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

const Tablet = ({ children }: { children: ReactNode }) => {
  const isTablet = useMediaQuery({ minWidth: 768, maxWidth: 991 });
  return isTablet ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 1 other location - About 1 hr to fix
src/support/breakpoints.tsx on lines 29..32

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

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

const TabletAndAbove = ({ children }: { children: ReactNode }) => {
  const isTabletAndAbove = useMediaQuery({ minWidth: 768 });
  return isTabletAndAbove ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 4 other locations - About 1 hr to fix
src/support/breakpoints.tsx on lines 4..7
src/support/breakpoints.tsx on lines 9..12
src/support/breakpoints.tsx on lines 24..27
src/support/breakpoints.tsx on lines 34..37

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

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

const Desktop = ({ children }: { children: ReactNode }) => {
  const isDesktop = useMediaQuery({ minWidth: 992 });
  return isDesktop ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 4 other locations - About 1 hr to fix
src/support/breakpoints.tsx on lines 9..12
src/support/breakpoints.tsx on lines 19..22
src/support/breakpoints.tsx on lines 24..27
src/support/breakpoints.tsx on lines 34..37

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

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

const MobileAndBelow = ({ children }: { children: ReactNode }) => {
  const isMobileAndBelow = useMediaQuery({ maxWidth: 767 });
  return isMobileAndBelow ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 4 other locations - About 1 hr to fix
src/support/breakpoints.tsx on lines 4..7
src/support/breakpoints.tsx on lines 9..12
src/support/breakpoints.tsx on lines 19..22
src/support/breakpoints.tsx on lines 34..37

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

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

const MobileAndAbove = ({ children }: { children: ReactNode }) => {
  const isMobileAndAbove = useMediaQuery({ minWidth: 320 });
  return isMobileAndAbove ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 4 other locations - About 1 hr to fix
src/support/breakpoints.tsx on lines 4..7
src/support/breakpoints.tsx on lines 9..12
src/support/breakpoints.tsx on lines 19..22
src/support/breakpoints.tsx on lines 24..27

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

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

const TabletAndBelow = ({ children }: { children: ReactNode }) => {
  const isTabletAndBelow = useMediaQuery({ maxWidth: 991 });
  return isTabletAndBelow ? <>{children}</> : null;
};
Severity: Major
Found in src/support/breakpoints.tsx and 4 other locations - About 1 hr to fix
src/support/breakpoints.tsx on lines 4..7
src/support/breakpoints.tsx on lines 19..22
src/support/breakpoints.tsx on lines 24..27
src/support/breakpoints.tsx on lines 34..37

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

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

Missing return type on function.
Open

const Mobile = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const Desktop = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const TabletAndBelow = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const TabletAndAbove = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const Tablet = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const MobileAndBelow = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

Missing return type on function.
Open

const MobileAndAbove = ({ children }: { children: ReactNode }) => {
Severity: Minor
Found in src/support/breakpoints.tsx by eslint

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status