romanlex/app-manifest-webpack-plugin

View on GitHub

Showing 10 of 10 total issues

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

    response.files.forEach(file => {
      fileNames.push(pathPrefix + file.name)
      loader.emitFile(outputDir + file.name, file.contents)
    })
Severity: Major
Found in lib/favicons.js and 1 other location - About 1 hr to fix
lib/favicons.js on lines 75..78

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

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

    response.images.forEach(image => {
      fileNames.push(pathPrefix + image.name)
      loader.emitFile(outputDir + image.name, image.contents)
    })
Severity: Major
Found in lib/favicons.js and 1 other location - About 1 hr to fix
lib/favicons.js on lines 80..83

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

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 compileTemplate has 51 lines of code (exceeds 50 allowed). Consider refactoring.
Open

module.exports.compileTemplate = function compileTemplate(options, context, compilation) {
  const compilerPath = getCompilerPath(options.statsFilename, compilation.outputOptions.path)

  // The entry file is just an empty helper as the dynamic template
  // require is added in "loader.js"
Severity: Major
Found in lib/compiler.js - About 1 hr to fix

    Function emitCacheInformationFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function emitCacheInformationFile(loader, query, cacheFile, fileHash, iconResult) {
    Severity: Minor
    Found in lib/cache.js - About 35 mins to fix

      Function generateIcons has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function generateIcons(loader, imageFileStream, outputDir, originalQuery, callback) {
      Severity: Minor
      Found in lib/favicons.js - About 35 mins to fix

        Function loadIconsFromDiskCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function loadIconsFromDiskCache(loader, query, cacheFile, fileHash, callback) {
        Severity: Minor
        Found in lib/cache.js - About 35 mins to fix

          Parsing error: Unexpected token ...
          Open

                ...DEFAULT_OPTIONS,
          Severity: Minor
          Found in index.js by eslint

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

          Parsing error: Unexpected token )
          Open

                  )
          Severity: Minor
          Found in lib/favicons.js by eslint

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

          Parsing error: Unexpected token )
          Open

            )
          Severity: Minor
          Found in lib/compiler.js by eslint

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

          Parsing error: Unexpected token )
          Open

            )
          Severity: Minor
          Found in lib/cache.js by eslint

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

          Severity
          Category
          Status
          Source
          Language