fixjs/define.js

View on GitHub

Showing 149 of 149 total issues

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/define-promise-dev/define.promise.js and 1 other location - About 1 mo to fix
define.promise.js on lines 7..748

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in define.promise.js and 1 other location - About 1 mo to fix
examples/define-promise-dev/define.promise.js on lines 7..748

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/regular-amd-style/define.js and 5 other locations - About 1 mo to fix
examples/rjs-amd-optimizer/define.js on lines 7..622
examples/simple-promised-module/define.js on lines 7..622
define.js on lines 7..622
examples/define-module-mapping/define.js on lines 7..622
examples/definejs-promised-modules/define.js on lines 7..622

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in define.js and 5 other locations - About 1 mo to fix
examples/regular-amd-style/define.js on lines 7..622
examples/rjs-amd-optimizer/define.js on lines 7..622
examples/simple-promised-module/define.js on lines 7..622
examples/define-module-mapping/define.js on lines 7..622
examples/definejs-promised-modules/define.js on lines 7..622

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/definejs-promised-modules/define.js and 5 other locations - About 1 mo to fix
examples/regular-amd-style/define.js on lines 7..622
examples/rjs-amd-optimizer/define.js on lines 7..622
examples/simple-promised-module/define.js on lines 7..622
define.js on lines 7..622
examples/define-module-mapping/define.js on lines 7..622

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/define-module-mapping/define.js and 5 other locations - About 1 mo to fix
examples/regular-amd-style/define.js on lines 7..622
examples/rjs-amd-optimizer/define.js on lines 7..622
examples/simple-promised-module/define.js on lines 7..622
define.js on lines 7..622
examples/definejs-promised-modules/define.js on lines 7..622

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/simple-promised-module/define.js and 5 other locations - About 1 mo to fix
examples/regular-amd-style/define.js on lines 7..622
examples/rjs-amd-optimizer/define.js on lines 7..622
define.js on lines 7..622
examples/define-module-mapping/define.js on lines 7..622
examples/definejs-promised-modules/define.js on lines 7..622

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

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

(function (g, undefined) {
  
  var global = g();
  var fix = {
    options: {
Severity: Major
Found in examples/rjs-amd-optimizer/define.js and 5 other locations - About 1 mo to fix
examples/regular-amd-style/define.js on lines 7..622
examples/simple-promised-module/define.js on lines 7..622
define.js on lines 7..622
examples/define-module-mapping/define.js on lines 7..622
examples/definejs-promised-modules/define.js on lines 7..622

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

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

    function getUrl(modulePath) {
      var moduleName = getFileName(modulePath),
        url,
        urlArgs,
        path,
Severity: Major
Found in build/old/define.promise.js and 2 other locations - About 1 day to fix
build/old/define.debug.js on lines 85..130
build/old/define.js on lines 79..124

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

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

    function getUrl(modulePath) {
      var moduleName = getFileName(modulePath),
        url,
        urlArgs,
        path,
Severity: Major
Found in build/old/define.debug.js and 2 other locations - About 1 day to fix
build/old/define.js on lines 79..124
build/old/define.promise.js on lines 151..194

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

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

    function getUrl(modulePath) {
      var moduleName = getFileName(modulePath),
        url,
        urlArgs,
        path,
Severity: Major
Found in build/old/define.js and 2 other locations - About 1 day to fix
build/old/define.debug.js on lines 85..130
build/old/define.promise.js on lines 151..194

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

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

  function defineModuleDefinition() {
    var
      isOldOpera = typeof global.opera !== 'undefined' && global.opera.toString() === '[object Opera]',
      currentScript = document.currentScript,
      emptyArray = [],
Severity: Major
Found in build/old/define.promise.js - About 1 day to fix

    Function defineModuleDefinition has 352 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function defineModuleDefinition() {
        var
          isOldOpera = typeof global.opera !== 'undefined' && global.opera.toString() === '[object Opera]',
          currentScript = document.currentScript,
          emptyArray = [],
    Severity: Major
    Found in build/old/define.debug.js - About 1 day to fix

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

          function fxdefine(moduleName, array, moduleDefinition) {
            //define(moduleDefinition)
            if (typeof moduleName === 'function') {
              moduleDefinition = moduleName;
              moduleName = undefined;
      Severity: Major
      Found in build/old/define.debug.js and 1 other location - About 1 day to fix
      build/old/define.js on lines 332..382

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

      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

          function fxdefine(moduleName, array, moduleDefinition) {
            //define(moduleDefinition)
            if (typeof moduleName === 'function') {
              moduleDefinition = moduleName;
              moduleName = undefined;
      Severity: Major
      Found in build/old/define.js and 1 other location - About 1 day to fix
      build/old/define.debug.js on lines 351..401

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

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

        function defineModuleDefinition() {
          var
            isOldOpera = typeof global.opera !== 'undefined' && global.opera.toString() === '[object Opera]',
            currentScript = document.currentScript,
            emptyArray = [],
      Severity: Major
      Found in build/old/define.js - About 1 day to fix

        File define.promise.js has 644 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * DefineJS v0.2.9 2015-04-16T23:09Z
         * Copyright (c) 2014 Mehran Hatami and define.js contributors.
         * Available via the MIT license.
         * license found at http://github.com/fixjs/define.js/raw/master/LICENSE
        Severity: Major
        Found in examples/define-promise-dev/define.promise.js - About 1 day to fix

          File define.promise.js has 644 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * DefineJS v0.2.9 2015-04-16T23:09Z
           * Copyright (c) 2014 Mehran Hatami and define.js contributors.
           * Available via the MIT license.
           * license found at http://github.com/fixjs/define.js/raw/master/LICENSE
          Severity: Major
          Found in define.promise.js - About 1 day to fix

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

                function loadModule(modulePath, callback) {
                  var isFirstLoadDemand = false,
                    moduleName = getFileName(modulePath),
                    fileName,
                    modulesList;
            Severity: Major
            Found in build/old/define.js and 1 other location - About 1 day to fix
            build/old/define.debug.js on lines 264..304

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

            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

                function loadModule(modulePath, callback) {
                  var isFirstLoadDemand = false,
                    moduleName = getFileName(modulePath),
                    fileName,
                    modulesList;
            Severity: Major
            Found in build/old/define.debug.js and 1 other location - About 1 day to fix
            build/old/define.js on lines 245..285

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

            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