codevise/pageflow

View on GitHub
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js

Summary

Maintainability
F
5 days
Test Coverage

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

    it('ignores position', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'smart_contain';
      const position = [100, 100];
      const wrapperDimensions = {width: 210, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 61..73

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

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

    it('applies y position if video is scaled to match width', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'cover';
      const position = [100, 0];
      const wrapperDimensions = {width: 400, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 91..103

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

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

    it('scales video to fit width of wide wrapper', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'cover';
      const position = [];
      const wrapperDimensions = {width: 400, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 77..89

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

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

    it('scales video to fit width of wrapper that is a bit too wide', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'smart_contain';
      const position = [];
      const wrapperDimensions = {width: 210, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 19..31

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

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

    it('scales video to fit height of wrapper that is a bit too narrow', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'smart_contain';
      const position = [];
      const wrapperDimensions = {width: 190, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 33..45

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

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

    it('scales video to fit height of narrow wrapper', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'cover';
      const position = [];
      const wrapperDimensions = {width: 100, height: 200};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 105..117

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

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

    it('returns undefined if fit is contain', () => {
      const videoFile = {width: 200, height: 100};
      const fit = 'contain';
      const position = [];
      const wrapperDimensions = {width: 200, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 119..128
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 130..139

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

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

    it('returns undefined if wrapper is too narrow', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'smart_contain';
      const position = [];
      const wrapperDimensions = {width: 200, height: 200};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 6..15
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 130..139

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

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

    it('returns undefined if wrapper is too wide', () => {
      const videoFile = {width: 20, height: 10};
      const fit = 'smart_contain';
      const position = [];
      const wrapperDimensions = {width: 400, height: 100};
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 6..15
entry_types/paged/packages/pageflow-paged-react/src/media/components/VideoFilePlayer/Positioner/__spec__/getDimensions-spec.js on lines 119..128

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

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

There are no issues that match your filters.

Category
Status