amzn/style-dictionary

View on GitHub

Showing 182 of 182 total issues

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

  it('should do ios stuff', () => {
    StyleDictionaryExtended.buildPlatform('ios');
    expect(helpers.fileExists('./__tests__/__output/ios/style_dictionary.plist')).toBeTruthy();
    expect(helpers.fileExists('./__tests__/__output/ios/style_dictionary.h')).toBeTruthy();
  });
Severity: Major
Found in __tests__/buildPlatform.test.js and 2 other locations - About 1 hr to fix
__tests__/buildPlatform.test.js on lines 44..48
__tests__/buildPlatform.test.js on lines 50..54

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

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

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

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

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

Refactorings

Further Reading

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

      "red": {
        value: '#FF0000',
        original: { value: '#FF0000' },
        name: 'color_red',
        comment: 'comment',
Severity: Major
Found in __tests__/formats/all.test.js and 1 other location - About 1 hr to fix
__tests__/formats/all.test.js on lines 28..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 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

Function deepExtend has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function deepExtend(objects, collision, path) {
  if (objects == null)
    return {};

  var src, copyIsArray, copy, name, options, clone,
Severity: Minor
Found in lib/utils/deepExtend.js - About 1 hr to fix

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

      "allProperties": [{
          value: '#FF0000',
          original: { value: '#FF0000' },
          name: 'color_red',
          comment: 'comment',
    Severity: Major
    Found in __tests__/formats/all.test.js and 1 other location - About 1 hr to fix
    __tests__/formats/all.test.js on lines 44..57

    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

    Function extend has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    function extend(opts) {
      var options, to_ret;
    
      // Overloaded method, can accept a string as a path that points to a JS or
      // JSON file or a plain object. Potentially refactor.
    Severity: Minor
    Found in lib/extend.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    const actions = jsdoc2md.renderSync({
      files: ['lib/common/actions.js'],
      template: fs.readFileSync('scripts/handlebars/templates/actions.hbs').toString(),
      'no-gfm': true,
      separators: true,
    Severity: Major
    Found in scripts/generateDocs.js and 3 other locations - About 1 hr to fix
    scripts/generateDocs.js on lines 34..41
    scripts/generateDocs.js on lines 52..59
    scripts/generateDocs.js on lines 88..95

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

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

        describe('asset/objC/literal', () => {
          it('should work', () => {
            var value = transforms["asset/objC/literal"].transformer({
              value: "hello"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 604..611
    __tests__/common/transforms.test.js on lines 613..620

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

    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

    const formats = jsdoc2md.renderSync({
      files: ['lib/common/formats.js'],
      template: fs.readFileSync('scripts/handlebars/templates/formats.hbs').toString(),
      'no-gfm': true,
      separators: true,
    Severity: Major
    Found in scripts/generateDocs.js and 3 other locations - About 1 hr to fix
    scripts/generateDocs.js on lines 34..41
    scripts/generateDocs.js on lines 52..59
    scripts/generateDocs.js on lines 70..77

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

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

        describe('size/flutter/remToDouble', () => {
          it('should work', () => {
            var value = transforms["size/flutter/remToDouble"].transformer({
              value: "1"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 604..611
    __tests__/common/transforms.test.js on lines 613..620

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

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

        describe('content/quote', () => {
          it('should work', () => {
            var value = transforms["content/quote"].transformer({
              value: "hello"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 604..611
    __tests__/common/transforms.test.js on lines 613..620

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

    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

        class BaseColorItem implements BaseColorListItem {
            private final String title;
            private final String subtitle;
            public Property property;
    
    
    examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/BaseColorListItem.java on lines 49..69

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

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

        describe('font/objC/literal', () => {
          it('should work', () => {
            var value = transforms["font/objC/literal"].transformer({
              value: "hello"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 613..620

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

    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

    const transforms = jsdoc2md.renderSync({
      files: ['lib/common/transforms.js'],
      template: fs.readFileSync('scripts/handlebars/templates/transforms.hbs').toString(),
      'no-gfm': true,
      separators: true,
    Severity: Major
    Found in scripts/generateDocs.js and 3 other locations - About 1 hr to fix
    scripts/generateDocs.js on lines 52..59
    scripts/generateDocs.js on lines 70..77
    scripts/generateDocs.js on lines 88..95

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

    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

        class BaseColorHeaderItem implements BaseColorListItem {
            private final String title;
            private final String subtitle;
            public Property property;
    
    
    examples/complete/android/demo/src/main/java/com/amazon/styledictionaryexample/color/BaseColorListItem.java on lines 27..47

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

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

        describe('content/icon', () => {
          it('should work', () => {
            var value = transforms["content/icon"].transformer({
              value: ""
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 604..611
    __tests__/common/transforms.test.js on lines 613..620

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

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

        describe('content/objC/literal', () => {
          it('should work', () => {
            var value = transforms["content/objC/literal"].transformer({
              value: "hello"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 604..611
    __tests__/common/transforms.test.js on lines 613..620

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

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

        describe('time/seconds', () => {
          it('should work', () => {
            var value = transforms["time/seconds"].transformer({
              value: "1000"
            });
    Severity: Major
    Found in __tests__/common/transforms.test.js and 6 other locations - About 1 hr to fix
    __tests__/common/transforms.test.js on lines 559..566
    __tests__/common/transforms.test.js on lines 568..575
    __tests__/common/transforms.test.js on lines 577..584
    __tests__/common/transforms.test.js on lines 586..593
    __tests__/common/transforms.test.js on lines 595..602
    __tests__/common/transforms.test.js on lines 604..611

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

    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

    const transform_groups = jsdoc2md.renderSync({
      files: ['lib/common/transformGroups.js'],
      template: fs.readFileSync('scripts/handlebars/templates/transform_groups.hbs').toString(),
      'no-gfm': true,
      separators: true,
    Severity: Major
    Found in scripts/generateDocs.js and 3 other locations - About 1 hr to fix
    scripts/generateDocs.js on lines 34..41
    scripts/generateDocs.js on lines 70..77
    scripts/generateDocs.js on lines 88..95

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

    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 getStyleDictionaryConfig has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getStyleDictionaryConfig(brand, platform) {
      return {
        "source": [
          `properties/brands/${brand}/*.json`,
          "properties/globals/**/*.json",
    Severity: Minor
    Found in examples/advanced/multi-brand-multi-platform/build.js - About 1 hr to fix

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

          } else if (file.format) {
            if (dictionary.format[file.format]) {
              ext.format = dictionary.format[file.format];
            } else {
              throw new Error('Can\'t find format: ' + file.format);
      Severity: Major
      Found in lib/transform/config.js and 1 other location - About 1 hr to fix
      lib/transform/config.js on lines 90..102

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

      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