SiLeBAT/FSK-Lab

View on GitHub

Showing 14,752 of 14,752 total issues

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

        bindEvents: function () {
            if (this.no_diapason) {
                return;
            }

Severity: Minor
Found in de.bund.bfr.knime.js/src/js/lib/ion.rangeSlider.js - About 1 hr to fix

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

        _process_options: function(opts){
            // Store raw options for reference
            this._o = $.extend({}, this._o, opts);
            // Processed options
            var o = this.o = $.extend({}, this._o);

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

  function d3_time_scale(linear, methods, format) {
    function scale(x) {
      return linear(x);
    }
    scale.invert = function(x) {

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

    _mouseCapture: function( event ) {
        var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
            that = this,
            o = this.options;

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

function stretchSpansOverChange(doc, change) {
  if (change.full) { return null }
  var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
  var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
  if (!oldFirst && !oldLast) { return null }

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

    _determineDate: function(inst, date, defaultDate) {
        var offsetNumeric = function(offset) {
                var date = new Date();
                date.setDate(date.getDate() + offset);
                return date;

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

function updateDisplayIfNeeded(cm, update) {
  var display = cm.display, doc = cm.doc

  if (update.editorIsHidden) {
    resetView(cm)

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

function indentLine(cm, n, how, aggressive) {
  var doc = cm.doc, state
  if (how == null) { how = "add" }
  if (how == "smart") {
    // Fall back to "prev" when the mode doesn't have an indentation

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

  function drawForLine(line, fromArg, toArg) {
    var lineObj = getLine(doc, line)
    var lineLen = lineObj.text.length
    var start, end
    function coords(ch, bias) {

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

function locateNodeInLineView(lineView, node, offset) {
  var wrapper = lineView.text.firstChild, bad = false
  if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
  if (node == wrapper) {
    bad = true

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

  function initUI() {

    function createMetadataList(parameter) {

      const formatProperty = (name, value) => value ? `<li><b>${name}</b>: ${value}</li>` : '';

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

  view.init = function (representation, value) {

    _rep = representation;
    _val = value;

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

  function drawForLine(line, fromArg, toArg) {
    var lineObj = getLine(doc, line)
    var lineLen = lineObj.text.length
    var start, end
    function coords(ch, bias) {

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

function indentLine(cm, n, how, aggressive) {
  var doc = cm.doc, state
  if (how == null) { how = "add" }
  if (how == "smart") {
    // Fall back to "prev" when the mode doesn't have an indentation

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

function updateDisplayIfNeeded(cm, update) {
  var display = cm.display, doc = cm.doc

  if (update.editorIsHidden) {
    resetView(cm)

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

function locateNodeInLineView(lineView, node, offset) {
  var wrapper = lineView.text.firstChild, bad = false
  if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
  if (node == wrapper) {
    bad = true

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

function stretchSpansOverChange(doc, change) {
  if (change.full) { return null }
  var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
  var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
  if (!oldFirst && !oldLast) { return null }

Method convertProduct has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    static Product convertProduct(JsonNode node) {

        Product product = new Product();

        if (node.has("productName")) {

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

Method saveWF has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private void saveWF() throws Exception {
        for (NodeContainer nc : WorkflowManager.ROOT.getNodeContainers()) {
            if (nc instanceof WorkflowManager) {
                WorkflowManager wfm = (WorkflowManager) nc;
                for (WriterNodeModel m : wfm.findNodes(WriterNodeModel.class, true).values()) {

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

Method createDataset has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private XYDataset createDataset(final Double mini, final Double maxi, final double step) {
        series2.clear();
        newStrDataSet = "";
        for (int i=0;i<table1.getModel().getRowCount();i++) {
            Object o1 = table1.getModel().getValueAt(i, 0);

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

Severity
Category
Status
Source
Language