Kentico/gatsby-source-kontent

View on GitHub

Showing 27 of 40 total issues

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

const getKontentTypeArtifact = (
  api: SourceNodesArgs,
  kontentType: KontentType,
  includeRawContent: boolean,
): KontentType => {
Severity: Major
Found in packages/gatsby-source-kontent/src/sourceNodes.types.ts and 1 other location - About 5 hrs to fix
packages/gatsby-source-kontent/src/sourceNodes.taxonomies.ts on lines 9..30

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

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 getKontentTypeArtifact = (
  api: SourceNodesArgs,
  kontentTaxonomy: KontentTaxonomy,
  includeRawContent: boolean,
): KontentTaxonomy => {
Severity: Major
Found in packages/gatsby-source-kontent/src/sourceNodes.taxonomies.ts and 1 other location - About 5 hrs to fix
packages/gatsby-source-kontent/src/sourceNodes.types.ts on lines 14..35

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

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 getKontentItemElementsSchemaTypeName = (
  type: string,
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}${CONNECTOR}${type}${CONNECTOR}${MULTI_ELEMENT_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 1 other location - About 1 hr to fix
packages/gatsby-source-kontent/src/naming.ts on lines 58..62

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

const getKontentItemElementValueTypeNameByType = (
  type: string,
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}${CONNECTOR}${type}${CONNECTOR}${ELEMENT_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 1 other location - About 1 hr to fix
packages/gatsby-source-kontent/src/naming.ts 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 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 2 locations. Consider refactoring.
Open

  try {
    await kontentItemsCreateSchemaCustomization(api, pluginConfig);
    if (pluginConfig.includeTaxonomies) {
      await kontentTaxonomiesCreateSchemaCustomization(api);
    }
Severity: Major
Found in packages/gatsby-source-kontent/gatsby-node.ts and 1 other location - About 1 hr to fix
packages/gatsby-source-kontent/gatsby-node.ts on lines 45..67

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

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

  try {
    if(!_.isEmpty(api.webhookBody)){ //preview run
      await handleIncomingWebhook(api, pluginConfig, itemTypes);
      return;
    }
Severity: Major
Found in packages/gatsby-source-kontent/gatsby-node.ts and 1 other location - About 1 hr to fix
packages/gatsby-source-kontent/gatsby-node.ts on lines 23..38

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

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

const getKontentTaxonomyNodeStringForCodeName = (
  codename: string,
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TAXONOMY_IDENTIFIER}${CONNECTOR}${codename}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 2 other locations - About 1 hr to fix
packages/gatsby-source-kontent/src/naming.ts on lines 37..41
packages/gatsby-source-kontent/src/naming.ts on lines 95..99

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

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

const getKontentItemNodeTypeName = (
  type: string,
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}${CONNECTOR}${type}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 2 other locations - About 1 hr to fix
packages/gatsby-source-kontent/src/naming.ts on lines 75..79
packages/gatsby-source-kontent/src/naming.ts on lines 95..99

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

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

const getKontentTypeNodeStringForCodeName = (
  codename: string,
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TYPE_IDENTIFIER}${CONNECTOR}${codename}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 2 other locations - About 1 hr to fix
packages/gatsby-source-kontent/src/naming.ts on lines 37..41
packages/gatsby-source-kontent/src/naming.ts on lines 75..79

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

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 createSchemaCustomization = async (
  api: CustomCreateSchemaCustomizationArgs,
): Promise<void> => {
  const schema = getKontentTypesSchemaNamingConfiguration();
  api.actions.createTypes(schema);
packages/gatsby-source-kontent/src/createSchemaCustomization.taxonomies.ts on lines 4..9

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

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

const getKontentTaxonomyTermTypeName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TAXONOMY_IDENTIFIER}${CONNECTOR}${TAXONOMY_TERM_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 110..113
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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

const getKontentItemSystemElementTypeName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}${CONNECTOR}${SYSTEM_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 110..113
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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

const getKontentTypesCacheKey = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TYPE_IDENTIFIER}${CONNECTOR}${CACHE_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 110..113

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

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

const getKontentTypeElementTypeName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TYPE_IDENTIFIER}${CONNECTOR}${ELEMENT_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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

const getKontentTaxonomySystemElementTypeName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TAXONOMY_IDENTIFIER}${CONNECTOR}${SYSTEM_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 110..113
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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 createSchemaCustomization = async (
  api: CustomCreateSchemaCustomizationArgs,
): Promise<void> => {
  const schema = getKontentTaxonomiesSchemaNamingConfiguration();
  api.actions.createTypes(schema);
packages/gatsby-source-kontent/src/createSchemaCustomization.types.ts on lines 4..9

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

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

const getKontentTypeSystemElementTypeName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${TYPE_IDENTIFIER}${CONNECTOR}${SYSTEM_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 70..73
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 110..113
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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

const getKontentItemLanguageLinkExtensionName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string =>
  `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}${CONNECTOR}${LANGUAGE_LINK_EXTENSION_IDENTIFIER}`;
Severity: Major
Found in packages/gatsby-source-kontent/src/naming.ts and 6 other locations - About 55 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 47..50
packages/gatsby-source-kontent/src/naming.ts on lines 85..88
packages/gatsby-source-kontent/src/naming.ts on lines 90..93
packages/gatsby-source-kontent/src/naming.ts on lines 105..108
packages/gatsby-source-kontent/src/naming.ts on lines 110..113
packages/gatsby-source-kontent/src/naming.ts on lines 122..125

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

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

            {
              system: {
                type: "website",
                codename: "example_site",
              },
Severity: Minor
Found in site/src/pages/rich-text.js and 1 other location - About 35 mins to fix
site/src/pages/rich-text.js on lines 92..105

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

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

const getKontentItemInterfaceName = (
  config: PluginNamingConfiguration = defaultPluginNamingConfiguration,
): string => `${config.prefix}${CONNECTOR}${ITEM_IDENTIFIER}`;
Severity: Minor
Found in packages/gatsby-source-kontent/src/naming.ts and 2 other locations - About 35 mins to fix
packages/gatsby-source-kontent/src/naming.ts on lines 81..83
packages/gatsby-source-kontent/src/naming.ts on lines 101..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 46.

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