SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js

Summary

Maintainability
F
4 days
Test Coverage

File haxe.js has 449 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 6 hrs to fix

Function haxeTokenBase has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function haxeTokenBase(stream, state) {
    var ch = stream.next();
    if (ch == '"' || ch == "'") {
      return chain(stream, state, haxeTokenString(ch));
    } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 1 hr to fix

Function token has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    token: function (stream, state) {
      var ch = stream.peek();
      var sol = stream.sol();

      ///* comments */
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 1 hr to fix

Function HaxeLexical has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function HaxeLexical(indented, column, type, align, prev, info) {
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 45 mins to fix

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

  function parseHaxe(state, style, type, content, stream) {
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 35 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "operator") return cont(expression);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return ret("operator", null, stream.current());
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                     statement, poplex, popcontext);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "import") return cont(importdef, expect(";"));
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == ".") return cont(property, maybeoperator);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else if (lexical.align) return lexical.column + (closing ? 0 : 1);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "attribute") return cont(maybeattribute);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("operator", null, stream.current());
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("comment", "comment");
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
                                   poplex, statement, poplex);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "case") return cont(expression, expect(":"));
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return lexical.indented + (closing ? 0 : indentUnit);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return cont();
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("type", "variable-3", word);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "default") return cont(expect(":"));
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return ret("regexp", "string-2");
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "function") return cont(functiondef);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
                       ret("variable", "variable", word);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return chain(stream, state, haxeTokenComment);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("conditional", "meta");
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
                                      block, poplex, poplex);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return ret ("metadata", "meta");
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == ";") return cont();
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return pass(pushlex("stat"), expression, expect(";"), poplex);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "variable") return cont(pushlex("stat"), maybelabel);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "typedef") return cont(typedef);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
Severity: Major
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js - About 30 mins to fix

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

  function poplex() {
    var state = cx.state;
    if (state.lexical.prev) {
      if (state.lexical.type == ")")
        state.indented = state.lexical.indented;
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 341..348

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

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 HaxeLexical(indented, column, type, align, prev, info) {
    this.indented = indented;
    this.column = column;
    this.type = type;
    this.prev = prev;
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 219..226

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

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 haxeTokenComment(stream, state) {
    var maybeEnd = false, ch;
    while (ch = stream.next()) {
      if (ch == "/" && maybeEnd) {
        state.tokenize = haxeTokenBase;
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 148..158

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

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 popcontext() {
    cx.state.localVars = cx.state.context.vars;
    cx.state.context = cx.state.context.prev;
  }
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 325..328

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

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 pass() {
    for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
  }
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 261..263
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/tiki/tiki.js on lines 194..196

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

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

  function inList(name, list) {
    for (var v = list; v; v = v.next)
      if (v.name == name) return true;
    return false;
  }
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js and 1 other location - About 45 mins to fix
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 268..271

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

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 inScope(state, varname) {
    for (var v = state.localVars; v; v = v.next)
      if (v.name == varname) return true;
  }
Severity: Minor
Found in de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/haxe/haxe.js and 1 other location - About 30 mins to fix
de.bund.bfr.knime.js/js-lib/codemirror-5.49.2/mode/javascript/javascript.js on lines 231..234

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

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

There are no issues that match your filters.

Category
Status