phodal/congee

View on GitHub
ckeditor/plugins/autosave/js/difflib.js

Summary

Maintainability
F
5 days
Test Coverage

Function SequenceMatcher has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
Open

    SequenceMatcher: function (a, b, isjunk) {
        this.set_seqs = function (a, b) {
            this.set_seq1(a);
            this.set_seq2(b);
        }
Severity: Minor
Found in ckeditor/plugins/autosave/js/difflib.js - About 2 days 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

Function SequenceMatcher has 259 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    SequenceMatcher: function (a, b, isjunk) {
        this.set_seqs = function (a, b) {
            this.set_seq1(a);
            this.set_seq2(b);
        }
Severity: Major
Found in ckeditor/plugins/autosave/js/difflib.js - About 1 day to fix

    File difflib.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /***
    This is part of jsdifflib v1.0. <http://snowtide.com/jsdifflib>
    
    Copyright (c) 2007, Snowtide Informatics Systems, Inc.
    All rights reserved.
    Severity: Minor
    Found in ckeditor/plugins/autosave/js/difflib.js - About 3 hrs to fix

      Function find_longest_match has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this.find_longest_match = function (alo, ahi, blo, bhi) {
                  var a = this.a;
                  var b = this.b;
                  var b2j = this.b2j;
                  var isbjunk = this.isbjunk;
      Severity: Minor
      Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

        Function get_matching_blocks has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                this.get_matching_blocks = function () {
                    if (this.matching_blocks != null) return this.matching_blocks;
                    var la = this.a.length;
                    var lb = this.b.length;
            
        Severity: Minor
        Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

          Function get_grouped_opcodes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.get_grouped_opcodes = function (n) {
                      if (!n) n = 3;
                      var codes = this.get_opcodes();
                      if (!codes) codes = [["equal", 0, 1, 0, 1]];
                      var code, tag, i1, i2, j1, j2;
          Severity: Minor
          Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

            Function __chain_b has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    this.__chain_b = function () {
                        var b = this.b;
                        var n = b.length;
                        var b2j = this.b2j = {};
                        var populardict = {};
            Severity: Minor
            Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

              Function get_opcodes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.get_opcodes = function () {
                          if (this.opcodes != null) return this.opcodes;
                          var i = 0;
                          var j = 0;
                          var answer = [];
              Severity: Minor
              Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

                Function __ntuplecomp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    __ntuplecomp: function (a, b) {
                        var mlen = Math.max(a.length, b.length);
                        for (var i = 0; i < mlen; i++) {
                            if (a[i] < b[i]) return -1;
                            if (a[i] > b[i]) return 1;
                Severity: Minor
                Found in ckeditor/plugins/autosave/js/difflib.js - About 45 mins 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

                There are no issues that match your filters.

                Category
                Status