Showing 34 of 63 total issues
Function ae
has 1548 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ae = Pe((se, oe) => {
;(function () {
var t = function (e) {
var r = new t.Builder()
return (
File main.js
has 1953 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
'use strict'
;(() => {
var Se = Object.create
var re = Object.defineProperty
File Api.ts
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2015 Workfront
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
Function stemmer
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
;(t.stemmer = (function () {
var e = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
Function exports
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function query
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.Index.prototype.query = function (e) {
for (
var r = new t.Query(this.fields),
n = Object.create(null),
i = Object.create(null),
Api
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Api {
static Methods = {
GET: 'GET',
PUT: 'PUT',
DELETE: 'DELETE',
Function H
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
H = function (c) {
var v, C, T, h, x, O, F
if (c.length < 3) return c
if (
((T = c.substr(0, 1)),
Function fromFuzzyString
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.TokenSet.fromFuzzyString = function (e, r) {
for (
var n = new t.TokenSet(), i = [{node: n, editsRemaining: r, str: e}];
i.length;
Function populateQueryStringAndBodyParams
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
private populateQueryStringAndBodyParams(clonedParams, options) {
let bodyParams = null,
queryString = '',
contentType = null
if (typeof FormData !== 'undefined' && clonedParams instanceof FormData) {
- 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 batchApiFactory
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function batchApiFactory(api: Api): IBatchApi {
const apiClone = Object.create(api) as Api
apiClone._uriGenerationMode = true
return {
copy: (
Function createFieldVectors
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.Builder.prototype.createFieldVectors = function () {
for (
var e = {},
r = Object.keys(this.fieldTermFrequencies),
n = r.length,
Function populateQueryStringAndBodyParams
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private populateQueryStringAndBodyParams(clonedParams, options) {
let bodyParams = null,
queryString = '',
contentType = null
if (typeof FormData !== 'undefined' && clonedParams instanceof FormData) {
Function add
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.Builder.prototype.add = function (e, r) {
var n = e[this._ref],
i = Object.keys(this._fields)
;(this._documents[n] = r || {}), (this.documentCount += 1)
for (var s = 0; s < i.length; s++) {
Function load
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.Index.load = function (e) {
var r = {},
n = {},
i = e.fieldVectors,
s = Object.create(null),
Function intersect
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.TokenSet.prototype.intersect = function (e) {
for (
var r = new t.TokenSet(),
n = void 0,
i = [{qNode: e, output: r, node: this}];
Function request
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
request(
path: string,
params,
fields: TFields = [],
method: string = Api.Methods.GET
Function parseBoost
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.QueryParser.parseBoost = function (e) {
var r = e.consumeLexeme()
if (r != null) {
var n = parseInt(r.str, 10)
if (isNaN(n)) {
Function parseEditDistance
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.QueryParser.parseEditDistance = function (e) {
var r = e.consumeLexeme()
if (r != null) {
var n = parseInt(r.str, 10)
if (isNaN(n)) {
Function parsePresence
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(t.QueryParser.parsePresence = function (e) {
var r = e.consumeLexeme()
if (r != null) {
switch (r.str) {
case '-':