phodal/congee

View on GitHub

Showing 421 of 421 total issues

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

(function ( $ ) {

    var localization = $.spectrum.localization["es"] = {
        cancelText: "Cancelar",
        chooseText: "Elegir",
Severity: Major
Found in scripts/spectrum/i18n/jquery.spectrum-es.js and 10 other locations - About 3 hrs to fix
scripts/spectrum/i18n/jquery.spectrum-ar.js on lines 4..17
scripts/spectrum/i18n/jquery.spectrum-de.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-fr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-gr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-he.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-hr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-pl.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-pt-br.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-cn.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-tw.js on lines 5..18

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

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

(function ( $ ) {

    var localization = $.spectrum.localization["pt-br"] = {
        cancelText: "Cancelar",
        chooseText: "Escolher",
Severity: Major
Found in scripts/spectrum/i18n/jquery.spectrum-pt-br.js and 10 other locations - About 3 hrs to fix
scripts/spectrum/i18n/jquery.spectrum-ar.js on lines 4..17
scripts/spectrum/i18n/jquery.spectrum-de.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-es.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-fr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-gr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-he.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-hr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-pl.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-cn.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-tw.js on lines 5..18

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

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

(function ( $ ) {

    var localization = $.spectrum.localization["he"] = {
        cancelText: "בטל בחירה",
        chooseText: "בחר צבע",
Severity: Major
Found in scripts/spectrum/i18n/jquery.spectrum-he.js and 10 other locations - About 3 hrs to fix
scripts/spectrum/i18n/jquery.spectrum-ar.js on lines 4..17
scripts/spectrum/i18n/jquery.spectrum-de.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-es.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-fr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-gr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-hr.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-pl.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-pt-br.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-cn.js on lines 5..18
scripts/spectrum/i18n/jquery.spectrum-zh-tw.js on lines 5..18

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

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

  for ( var i = 0; i < n.length; i++ ) {
    if ( ns[ n[i] ] == null )
      ns[ n[i] ] = { rows: new Array(), o: null };
    ns[ n[i] ].rows.push( i );
  }
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 3 hrs to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 130..134

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

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

  for ( var i = 0; i < o.length; i++ ) {
    if ( os[ o[i] ] == null )
      os[ o[i] ] = { rows: new Array(), n: null };
    os[ o[i] ].rows.push( i );
  }
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 3 hrs to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 124..128

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

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

    if (cap = this.rules.strong.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.strong(this.output(cap[2] || cap[1]));
      continue;
    }
Severity: Major
Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/markdown/js/marked.js on lines 651..655

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

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

    if (cap = this.rules.em.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.em(this.output(cap[2] || cap[1]));
      continue;
    }
Severity: Major
Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/markdown/js/marked.js on lines 644..648

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

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

      if (out.o[i].text != null) {
          os += escape_jsdiff(out.o[i].text) + oSpace[i];
      } else {
          os += "<del>" + escape_jsdiff(out.o[i]) + oSpace[i] + "</del>";
      }
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 110..114

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

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

      if (out.n[i].text != null) {
          ns += escape_jsdiff(out.n[i].text) + nSpace[i];
      } else {
          ns += "<ins>" + escape_jsdiff(out.n[i]) + nSpace[i] + "</ins>";
      }
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 101..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 93.

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

      item = {
        type: 'table',
        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
        cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
Severity: Major
Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/markdown/js/marked.js on lines 211..216

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

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

      item = {
        type: 'table',
        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
        cells: cap[3].replace(/\n$/, '').split('\n')
Severity: Major
Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 2 hrs to fix
ckeditor/plugins/markdown/js/marked.js on lines 382..387

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

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

        pixelSearch: ( function() {
            var contains = CKEDITOR.env.ie || CKEDITOR.env.webkit ?
                function( el, found ) {
                    return el.contains( found );
                } : function( el, found ) {
Severity: Major
Found in ckeditor/plugins/lineutils/plugin.js - About 2 hrs to fix

    Function _layout has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        _layout: function() {
            var area = this.element,
                editor = this.editor,
                contentsRect = editor.ui.contentsElement.getClientRect(),
                contentsPos = editor.ui.contentsElement.getDocumentPosition(),
    Severity: Minor
    Found in ckeditor/plugins/notification/plugin.js - About 2 hrs 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

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

        function lighten (color, amount) {
            amount = (amount === 0) ? 0 : (amount || 10);
            var hsl = tinycolor(color).toHsl();
            hsl.l += amount / 100;
            hsl.l = clamp01(hsl.l);
    Severity: Major
    Found in scripts/spectrum/spectrum.js and 1 other location - About 2 hrs to fix
    scripts/spectrum/spectrum.js on lines 1741..1747

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

    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 saturate(color, amount) {
            amount = (amount === 0) ? 0 : (amount || 10);
            var hsl = tinycolor(color).toHsl();
            hsl.s += amount / 100;
            hsl.s = clamp01(hsl.s);
    Severity: Major
    Found in scripts/spectrum/spectrum.js and 1 other location - About 2 hrs to fix
    scripts/spectrum/spectrum.js on lines 1753..1759

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

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

    function marked(src, opt, callback) {
      if (callback || typeof opt === 'function') {
        if (!callback) {
          callback = opt;
          opt = null;
    Severity: Major
    Found in ckeditor/plugins/markdown/js/marked.js - About 2 hrs to fix

      Function configure has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  configure: function (cfg) {
                      //Make sure the baseUrl ends in a slash.
                      if (cfg.baseUrl) {
                          if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
                              cfg.baseUrl += '/';
      Severity: Major
      Found in scripts/libs/require.js - About 2 hrs to fix

        Function GenerateAutoSaveDialog has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function GenerateAutoSaveDialog(editorInstance, autoSaveKey) {
                CKEDITOR.dialog.add('autosaveDialog', function() {
                    return {
                        title: editorInstance.lang.autosave.title,
                        minHeight: 155,
        Severity: Major
        Found in ckeditor/plugins/autosave/plugin.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                  if (a && getParsingFlags(m).overflow === -2) {
                      overflow =
                          a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :
                          a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
                          a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
          Severity: Critical
          Found in ckeditor/plugins/autosave/js/moment.js - About 2 hrs to fix

            Function draggable has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function draggable(element, onmove, onstart, onstop) {
                    onmove = onmove || function () { };
                    onstart = onstart || function () { };
                    onstop = onstop || function () { };
                    var doc = document;
            Severity: Major
            Found in scripts/spectrum/spectrum.js - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language