mbland/pages-server

View on GitHub

Showing 11 of 11 total issues

Function launchBuilder has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

SiteBuilder.launchBuilder = function(hook, branch, builderConfig) {
  var builderOpts = new Options(hook, config, builderConfig),
      buildLog = builderOpts.sitePath + '.log',
      logger = new BuildLogger(buildLog),
      builder = new SiteBuilder(branch,
Severity: Minor
Found in lib/site-builder.js - About 1 hr to fix

    Function doRun has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function doRun(runner, path, args, opts, message) {
      return new Promise(function(resolve, reject) {
        var command,
            options = opts || {cwd: runner.sitePath},
            msg = message || 'rebuild failed for',
    Severity: Minor
    Found in lib/command-runner.js - About 1 hr to fix

      Function exports has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(hook) {
        var branch = hook.ref,
            repository = hook.repository,
            commit = hook.head_commit,
            pusher = hook.pusher
      Severity: Minor
      Found in lib/webhooks/github.js - About 1 hr to fix

        Function build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        SiteBuilder.prototype.build = function() {
          var builder = this,
              doBuild
        
          doBuild = function() {
        Severity: Minor
        Found in lib/site-builder.js - About 1 hr to fix

          Function sync has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Sync.prototype.sync = function(buildDestination) {
            var homePrefix = path.join(this.home, path.sep),
                s3Prefix = buildDestination
                  .substr(homePrefix.length)
                  .replace(/\\/g, '/'),
          Severity: Minor
          Found in lib/sync.js - About 1 hr to fix

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

            function syncResults(builder) {
              return builder.configHandler.buildConfigurations().reduce(
                function(previousSync, buildConfig) {
                  return generateSyncOp(builder, previousSync, buildConfig)
                },
            Severity: Major
            Found in lib/site-builder.js and 1 other location - About 1 hr to fix
            lib/site-builder.js on lines 73..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 55.

            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 rsync(builder) {
              return builder.configHandler.buildConfigurations().reduce(
                function(previousRsync, buildConfig) {
                  return generateRsyncOp(builder, previousRsync, buildConfig)
                },
            Severity: Major
            Found in lib/site-builder.js and 1 other location - About 1 hr to fix
            lib/site-builder.js on lines 102..108

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

            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

            BuildLogger.prototype.error = function() {
              log.error.apply(log, arguments)
              writeToLogFile.apply(this.logFile, arguments)
            }
            Severity: Minor
            Found in lib/build-logger.js and 1 other location - About 50 mins to fix
            lib/build-logger.js on lines 27..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 52.

            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

            BuildLogger.prototype.log = function() {
              log.info.apply(log, arguments)
              writeToLogFile.apply(this.logFile, arguments)
            }
            Severity: Minor
            Found in lib/build-logger.js and 1 other location - About 50 mins to fix
            lib/build-logger.js on lines 32..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 52.

            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 ComponentFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function ComponentFactory(config, builderOpts, branch, s3client, logger) {
            Severity: Minor
            Found in lib/component-factory.js - About 35 mins to fix

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

              function doRun(runner, path, args, opts, message) {
              Severity: Minor
              Found in lib/command-runner.js - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language