app/assets/javascripts/app/lib/base/linkify.js
Function linkify
has 2298 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var linkify = (function (exports) {
'use strict';
/**
* Finite State Machine generation utilities
File linkify.js
has 2370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* Linkify v3.0.5
* https://github.com/Hypercontext/linkifyjs
* Copyright (c) 2021 SoapBox Innovations Inc.; Licensed MIT
*
Function linkify
has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring. Open
Open
var linkify = (function (exports) {
'use strict';
/**
* Finite State Machine generation utilities
- Read upRead up
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 init$1
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init$1() {
// The universal starting state.
var S_START = makeState(); // Intermediate states for URLs. Note that domains that begin with a protocol
// are treated slighly differently from those that don't.
Function linkifyStr
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
var linkifyStr = (function (linkifyjs) {
'use strict';
/**
Convert strings of text into linkable HTML text
- Read upRead up
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 init$2
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init$2() {
var customProtocols = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
// Frequently used states
var S_START = makeState();
var S_NUM = makeAcceptingState(NUM);
Function linkifyStr
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var linkifyStr = (function (linkifyjs) {
'use strict';
/**
Convert strings of text into linkable HTML text
Function run
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function run(start, input, tokens) {
var len = tokens.length;
var cursor = 0;
var multis = [];
var textTokens = [];
Function run$1
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function run$1(start, str) {
// State machine is not case sensitive, so input is tokenized in lowercased
// form (still returns the regular case though) Uses selective `toLowerCase`
// is used because lowercasing the entire string causes the length and
// character position to vary in some non-English strings with V8-based
Function linkifyStr
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function linkifyStr(str) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
opts = new linkifyjs.Options(opts);
var tokens = linkifyjs.tokenize(str);
var result = [];