amzn/style-dictionary

View on GitHub

Showing 182 of 182 total issues

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

      it('should handle rgb (object) colors', () => {
        var value = transforms["color/hex"].transformer({
          value: {
            r: '170',
            g: '170',
Severity: Major
Found in __tests__/common/transforms.test.js and 1 other location - About 3 hrs to fix
__tests__/common/transforms.test.js on lines 252..265

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

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

    it('should gracefully handle basic circular references', () => {
      GroupMessages.clear(PROPERTY_REFERENCE_WARNINGS);

      resolveObject(helpers.fileToJSON(__dirname + '/../__json_files/circular.json'));
      expect(GroupMessages.count(PROPERTY_REFERENCE_WARNINGS)).toBe(1);
Severity: Major
Found in __tests__/utils/resolveObject.test.js and 4 other locations - About 3 hrs to fix
__tests__/utils/resolveObject.test.js on lines 129..137
__tests__/utils/resolveObject.test.js on lines 139..147
__tests__/utils/resolveObject.test.js on lines 149..157
__tests__/utils/resolveObject.test.js on lines 159..167

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

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

    it('should gracefully handle basic and nested circular references', () => {
      GroupMessages.clear(PROPERTY_REFERENCE_WARNINGS);

      resolveObject(helpers.fileToJSON(__dirname + '/../__json_files/circular_2.json'));
      expect(GroupMessages.count(PROPERTY_REFERENCE_WARNINGS)).toBe(1);
Severity: Major
Found in __tests__/utils/resolveObject.test.js and 4 other locations - About 3 hrs to fix
__tests__/utils/resolveObject.test.js on lines 119..127
__tests__/utils/resolveObject.test.js on lines 139..147
__tests__/utils/resolveObject.test.js on lines 149..157
__tests__/utils/resolveObject.test.js on lines 159..167

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

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

    it('should gracefully handle down-chain circular references', () => {
      GroupMessages.clear(PROPERTY_REFERENCE_WARNINGS);

      resolveObject(helpers.fileToJSON(__dirname + '/../__json_files/circular_5.json'));
      expect(GroupMessages.count(PROPERTY_REFERENCE_WARNINGS)).toBe(1);
Severity: Major
Found in __tests__/utils/resolveObject.test.js and 4 other locations - About 3 hrs to fix
__tests__/utils/resolveObject.test.js on lines 119..127
__tests__/utils/resolveObject.test.js on lines 129..137
__tests__/utils/resolveObject.test.js on lines 139..147
__tests__/utils/resolveObject.test.js on lines 149..157

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

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

    it('should gracefully handle multiple nested circular references', () => {
      GroupMessages.clear(PROPERTY_REFERENCE_WARNINGS);

      resolveObject(helpers.fileToJSON(__dirname + '/../__json_files/circular_4.json'));
      expect(GroupMessages.count(PROPERTY_REFERENCE_WARNINGS)).toBe(1);
Severity: Major
Found in __tests__/utils/resolveObject.test.js and 4 other locations - About 3 hrs to fix
__tests__/utils/resolveObject.test.js on lines 119..127
__tests__/utils/resolveObject.test.js on lines 129..137
__tests__/utils/resolveObject.test.js on lines 139..147
__tests__/utils/resolveObject.test.js on lines 159..167

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

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

    it('should gracefully handle nested circular references', () => {
      GroupMessages.clear(PROPERTY_REFERENCE_WARNINGS);

      resolveObject(helpers.fileToJSON(__dirname + '/../__json_files/circular_3.json'));
      expect(GroupMessages.count(PROPERTY_REFERENCE_WARNINGS)).toBe(1);
Severity: Major
Found in __tests__/utils/resolveObject.test.js and 4 other locations - About 3 hrs to fix
__tests__/utils/resolveObject.test.js on lines 119..127
__tests__/utils/resolveObject.test.js on lines 129..137
__tests__/utils/resolveObject.test.js on lines 149..157
__tests__/utils/resolveObject.test.js on lines 159..167

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

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

Function transformConfig has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function transformConfig(config, dictionary, platformName) {
  var to_ret = _.clone(config);

  // The platform can define either a transformGroup or an array
  // of transforms. If given a transformGroup that doesn't exist,
Severity: Major
Found in lib/transform/config.js - About 3 hrs to fix

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

        let collisions = properties.allProperties.map((properties) => {
          let propertyPathText = chalk.keyword('orangered')(properties.path.join('.'));
          let valueText = chalk.keyword('darkorange')(properties.value);
          return propertyPathText + '   ' + valueText;
        }).join('\n        ');
    Severity: Major
    Found in __tests__/buildFile.test.js and 1 other location - About 3 hrs to fix
    lib/buildFile.js on lines 64..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 98.

    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

          let collisions = nameCollisionObj[propertyName].map((properties) => {
            let propertyPathText = chalk.keyword('orangered')(properties.path.join('.'));
            let valueText = chalk.keyword('darkorange')(properties.value);
            return propertyPathText + '   ' + valueText;
          }).join('\n        ');
    Severity: Major
    Found in lib/buildFile.js and 1 other location - About 3 hrs to fix
    __tests__/buildFile.test.js on lines 76..80

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

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

      'size/remToDp': {
        type: 'value',
        matcher: isNotFontSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 3 other locations - About 2 hrs to fix
    lib/common/transforms.js on lines 562..570
    lib/common/transforms.js on lines 648..656
    lib/common/transforms.js on lines 689..697

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

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

      'size/remToSp': {
        type: 'value',
        matcher: isFontSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 3 other locations - About 2 hrs to fix
    lib/common/transforms.js on lines 584..592
    lib/common/transforms.js on lines 648..656
    lib/common/transforms.js on lines 689..697

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

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

      'size/remToPt': {
        type: 'value',
        matcher: isSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 3 other locations - About 2 hrs to fix
    lib/common/transforms.js on lines 562..570
    lib/common/transforms.js on lines 584..592
    lib/common/transforms.js on lines 689..697

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

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

      'size/remToPx': {
        type: 'value',
        matcher: isSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 3 other locations - About 2 hrs to fix
    lib/common/transforms.js on lines 562..570
    lib/common/transforms.js on lines 584..592
    lib/common/transforms.js on lines 648..656

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

    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('should work with js config', () => {
        var StyleDictionaryExtended = StyleDictionary.extend(__dirname + '/__configs/test.js');
        StyleDictionaryExtended.buildAllPlatforms();
        expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy();
        expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy();
    Severity: Major
    Found in __tests__/buildAllPlatforms.test.js and 1 other location - About 2 hrs to fix
    __tests__/buildAllPlatforms.test.js on lines 27..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 86.

    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('should work with json config', () => {
        var StyleDictionaryExtended = StyleDictionary.extend(__dirname + '/__configs/test.json');
        StyleDictionaryExtended.buildAllPlatforms();
        expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy();
        expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy();
    Severity: Major
    Found in __tests__/buildAllPlatforms.test.js and 1 other location - About 2 hrs to fix
    __tests__/buildAllPlatforms.test.js on lines 34..39

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

    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

      'size/sp': {
        type: 'value',
        matcher: isFontSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 1 other location - About 2 hrs to fix
    lib/common/transforms.js on lines 541..549

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

    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

      'size/dp': {
        type: 'value',
        matcher: isNotFontSize,
        transformer: function(prop) {
          const val = parseFloat(prop.value);
    Severity: Major
    Found in lib/common/transforms.js and 1 other location - About 2 hrs to fix
    lib/common/transforms.js on lines 520..528

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

    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('should delete with buildPath', () => {
        buildFiles( dictionary, platformWithBuildPath );
        cleanFiles( dictionary, platformWithBuildPath );
        cleanDirs( dictionary, platformWithBuildPath );
        expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1/extradir2')).toBeTruthy();
    Severity: Major
    Found in __tests__/cleanDirs.test.js and 1 other location - About 2 hrs to fix
    __tests__/cleanDirs.test.js on lines 58..64

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

    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('should delete without buildPath', () => {
        buildFiles( dictionary, platform );
        cleanFiles( dictionary, platform );
        cleanDirs( dictionary, platform );
        expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1/extradir2')).toBeTruthy();
    Severity: Major
    Found in __tests__/cleanDirs.test.js and 1 other location - About 2 hrs to fix
    __tests__/cleanDirs.test.js on lines 66..72

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

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

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

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

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

    Refactorings

    Further Reading

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

    function registerFormat(options) {
      if (typeof options.name !== 'string')
        throw new Error('Can\'t register format; format.name must be a string');
      if (typeof options.formatter !== 'function')
        throw new Error('Can\'t register format; format.formatter must be a function');
    Severity: Major
    Found in lib/register/format.js and 1 other location - About 2 hrs to fix
    lib/register/filter.js on lines 32..41

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

    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