Sonia-corporation/ngx-achievements

View on GitHub

Showing 20 of 20 total issues

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

function success(scope, message) {
  console.log(`${_.toString(getLogTypePrefix(`success`))}${getContext(scope)}${_.toString(message)}`);
}
Severity: Major
Found in tools/logger.js and 4 other locations - About 1 hr to fix
tools/logger.js on lines 28..30
tools/logger.js on lines 38..40
tools/logger.js on lines 58..60
tools/logger.js on lines 68..70

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

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

function log(scope, message) {
  console.log(`${_.toString(getLogTypePrefix(`log`))}${getContext(scope)}${_.toString(message)}`);
}
Severity: Major
Found in tools/logger.js and 4 other locations - About 1 hr to fix
tools/logger.js on lines 28..30
tools/logger.js on lines 38..40
tools/logger.js on lines 48..50
tools/logger.js on lines 68..70

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

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

function debug(scope, message) {
  console.log(`${_.toString(getLogTypePrefix(`debug`))}${getContext(scope)}${_.toString(message)}`);
}
Severity: Major
Found in tools/logger.js and 4 other locations - About 1 hr to fix
tools/logger.js on lines 28..30
tools/logger.js on lines 38..40
tools/logger.js on lines 48..50
tools/logger.js on lines 58..60

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

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

function error(scope, message) {
  console.log(`${_.toString(getLogTypePrefix(`error`))}${getContext(scope)}${_.toString(message)}`);
}
Severity: Major
Found in tools/logger.js and 4 other locations - About 1 hr to fix
tools/logger.js on lines 38..40
tools/logger.js on lines 48..50
tools/logger.js on lines 58..60
tools/logger.js on lines 68..70

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

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

function warning(scope, message) {
  console.log(`${_.toString(getLogTypePrefix(`warning`))}${getContext(scope)}${_.toString(message)}`);
}
Severity: Major
Found in tools/logger.js and 4 other locations - About 1 hr to fix
tools/logger.js on lines 28..30
tools/logger.js on lines 48..50
tools/logger.js on lines 58..60
tools/logger.js on lines 68..70

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

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

async function setAssetsUrls() {
  for (const locale of LOCALES) {
    LOGGER.log(CONTEXT, CHALK.text(`Handling ${CHALK.value(locale)}...`));

    const folderPath = `gh-pages/${locale}`;
Severity: Minor
Found in tools/gh-pages/set-assets-urls.js - About 1 hr to fix

Function setAssetsUrls has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

async function setAssetsUrls() {
  for (const locale of LOCALES) {
    LOGGER.log(CONTEXT, CHALK.text(`Handling ${CHALK.value(locale)}...`));

    const folderPath = `gh-pages/${locale}`;
Severity: Minor
Found in tools/gh-pages/set-assets-urls.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

Parsing error: The keyword 'const' is reserved
Open

const FS = require(`fs-extra`);
Severity: Minor
Found in tools/gh-pages/set-assets-urls.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const FS = require(`fs-extra`);

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

Parsing error: The keyword 'const' is reserved
Open

const nxPreset = require('@nrwl/jest/preset');
Severity: Minor
Found in jest.preset.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const ghPages = require('gh-pages');
Severity: Minor
Found in tools/gh-pages/deploy-to-gh-pages.js by eslint

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

Parsing error: Unexpected character '`'
Open

  allowBreakingChanges: [`feat`, `fix`],
Severity: Minor
Found in tools/commitizen.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const { guessProductionMode } = require('@ngneat/tailwind');
Severity: Minor
Found in tailwind.config.js by eslint

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

Parsing error: Unexpected token >
Open

  '*.{ts,js}': files => {
Severity: Minor
Found in lint-staged.config.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const CHALKI = require(`chalk`);
Severity: Minor
Found in tools/chalk.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const fs = require('fs');
Severity: Minor
Found in decorate-angular-cli.js by eslint

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

Parsing error: Unexpected character '`'
Open

  cacheDirectory: `<rootDir>/.cache-jest`,
Severity: Minor
Found in apps/website/jest.config.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const { getJestProjects } = require('@nrwl/jest');
Severity: Minor
Found in jest.config.js by eslint

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

Parsing error: The keyword 'const' is reserved
Open

const CHALK = require(`./chalk`);
Severity: Minor
Found in tools/logger.js by eslint

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

Definition for rule '@nrwl/nx/enforce-module-boundaries' was not found.
Open

// ***********************************************************

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

Severity
Category
Status
Source
Language