Workfront/workfront-api

View on GitHub

Showing 34 of 63 total issues

Function ae has 1548 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var ae = Pe((se, oe) => {
        ;(function () {
            var t = function (e) {
                var r = new t.Builder()
                return (
Severity: Major
Found in docs/assets/main.js - About 1 wk to fix

    File main.js has 1953 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict'
    'use strict'
    ;(() => {
        var Se = Object.create
        var re = Object.defineProperty
    Severity: Major
    Found in docs/assets/main.js - About 5 days to fix

      File Api.ts has 550 lines of code (exceeds 250 allowed). Consider refactoring.
      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.
      Severity: Major
      Found in src/Api.ts - About 1 day to fix

        Function stemmer has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    ;(t.stemmer = (function () {
                        var e = {
                                ational: 'ate',
                                tional: 'tion',
                                enci: 'ence',
        Severity: Major
        Found in docs/assets/main.js - About 5 hrs to fix

          Function exports has 124 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
              config.set({
                  // base path that will be used to resolve all patterns (eg. files, exclude)
                  basePath: '',
          
          
          Severity: Major
          Found in karma.conf.js - About 4 hrs to fix

            Function query has 114 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            (t.Index.prototype.query = function (e) {
                                for (
                                    var r = new t.Query(this.fields),
                                        n = Object.create(null),
                                        i = Object.create(null),
            Severity: Major
            Found in docs/assets/main.js - About 4 hrs to fix

              Api has 27 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class Api {
                  static Methods = {
                      GET: 'GET',
                      PUT: 'PUT',
                      DELETE: 'DELETE',
              Severity: Minor
              Found in src/Api.ts - About 3 hrs to fix

                Function H has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    H = function (c) {
                                        var v, C, T, h, x, O, F
                                        if (c.length < 3) return c
                                        if (
                                            ((T = c.substr(0, 1)),
                Severity: Major
                Found in docs/assets/main.js - About 2 hrs to fix

                  Function fromFuzzyString has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  (t.TokenSet.fromFuzzyString = function (e, r) {
                                      for (
                                          var n = new t.TokenSet(), i = [{node: n, editsRemaining: r, str: e}];
                                          i.length;
                  
                  
                  Severity: Major
                  Found in docs/assets/main.js - About 2 hrs to fix

                    Function populateQueryStringAndBodyParams has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private populateQueryStringAndBodyParams(clonedParams, options) {
                            let bodyParams = null,
                                queryString = '',
                                contentType = null
                            if (typeof FormData !== 'undefined' && clonedParams instanceof FormData) {
                    Severity: Minor
                    Found in src/Api.ts - About 2 hrs 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 batchApiFactory has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function batchApiFactory(api: Api): IBatchApi {
                        const apiClone = Object.create(api) as Api
                        apiClone._uriGenerationMode = true
                        return {
                            copy: (
                    Severity: Minor
                    Found in src/Api.ts - About 1 hr to fix

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

                                      (t.Builder.prototype.createFieldVectors = function () {
                                          for (
                                              var e = {},
                                                  r = Object.keys(this.fieldTermFrequencies),
                                                  n = r.length,
                      Severity: Minor
                      Found in docs/assets/main.js - About 1 hr to fix

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

                            private populateQueryStringAndBodyParams(clonedParams, options) {
                                let bodyParams = null,
                                    queryString = '',
                                    contentType = null
                                if (typeof FormData !== 'undefined' && clonedParams instanceof FormData) {
                        Severity: Minor
                        Found in src/Api.ts - About 1 hr to fix

                          Function add has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          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++) {
                          Severity: Minor
                          Found in docs/assets/main.js - About 1 hr to fix

                            Function load has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            (t.Index.load = function (e) {
                                                var r = {},
                                                    n = {},
                                                    i = e.fieldVectors,
                                                    s = Object.create(null),
                            Severity: Minor
                            Found in docs/assets/main.js - About 1 hr to fix

                              Function intersect has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                              (t.TokenSet.prototype.intersect = function (e) {
                                                  for (
                                                      var r = new t.TokenSet(),
                                                          n = void 0,
                                                          i = [{qNode: e, output: r, node: this}];
                              Severity: Minor
                              Found in docs/assets/main.js - About 1 hr to fix

                                Function request has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    request(
                                        path: string,
                                        params,
                                        fields: TFields = [],
                                        method: string = Api.Methods.GET
                                Severity: Minor
                                Found in src/Api.ts - About 1 hr to fix

                                  Function parseBoost has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                  (t.QueryParser.parseBoost = function (e) {
                                                      var r = e.consumeLexeme()
                                                      if (r != null) {
                                                          var n = parseInt(r.str, 10)
                                                          if (isNaN(n)) {
                                  Severity: Minor
                                  Found in docs/assets/main.js - About 1 hr to fix

                                    Function parseEditDistance has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                    (t.QueryParser.parseEditDistance = function (e) {
                                                        var r = e.consumeLexeme()
                                                        if (r != null) {
                                                            var n = parseInt(r.str, 10)
                                                            if (isNaN(n)) {
                                    Severity: Minor
                                    Found in docs/assets/main.js - About 1 hr to fix

                                      Function parsePresence has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                                      (t.QueryParser.parsePresence = function (e) {
                                                          var r = e.consumeLexeme()
                                                          if (r != null) {
                                                              switch (r.str) {
                                                                  case '-':
                                      Severity: Minor
                                      Found in docs/assets/main.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language