Workfront/workfront-api

View on GitHub

Showing 34 of 63 total issues

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

    function Oe(t, e, r, n) {
        r.addEventListener(
            'input',
            ie(() => {
                Re(t, e, r, n)
Severity: Minor
Found in docs/assets/main.js - About 1 hr to fix

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

        batch(
            uriCollector: (batchApi: IBatchApi) => string[],
            isAtomic?: boolean,
            isConcurrent?: boolean
        ): Promise<any[] | void> {
    Severity: Minor
    Found in src/Api.ts - About 1 hr to fix

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

          function de() {
              let t = document.getElementById('tsd-search')
              if (!t) return
              let e = document.getElementById('tsd-search-script')
              t.classList.add('loading'),
      Severity: Minor
      Found in docs/assets/main.js - About 1 hr to fix

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

            getApiKey(username: string, password: string, subdomain?: string): Promise<string> {
                const loginParams = {
                    username,
                    password,
                }
        Severity: Minor
        Found in src/Api.ts - About 1 hr to fix

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

              success: (response) => {
                  if (response.ok) {
                      return response.json().then((data) => {
                          if (data.error) {
                              throw {
          Severity: Minor
          Found in src/Api.ts - About 1 hr to fix

            Function request has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                request(
                    path: string,
                    params,
                    fields: TFields = [],
                    method: string = Api.Methods.GET
            Severity: Minor
            Found in src/Api.ts - About 55 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

            Avoid deeply nested control flow statements.
            Open

                                                if (
                                                    (i[p].upsert(_, u.boost, function (Ee, be) {
                                                        return Ee + be
                                                    }),
                                                    !s[j])
            Severity: Major
            Found in docs/assets/main.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                  if (
                                                      (u.presence == t.Query.presence.REQUIRED &&
                                                          ((m = m.union(q)),
                                                          o[p] === void 0 && (o[p] = t.Set.complete)),
                                                      u.presence == t.Query.presence.PROHIBITED)
              Severity: Major
              Found in docs/assets/main.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                    for (var l = 0; l < a.length; l++) s.push(a[l])
                Severity: Major
                Found in docs/assets/main.js - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((e && typeof e == 'object') || typeof e == 'function')
                              for (let i of Te(e))
                                  !Qe.call(t, i) &&
                                      i !== r &&
                                      re(t, i, {get: () => e[i], enumerable: !(n = we(e, i)) || n.enumerable})
                  Severity: Major
                  Found in docs/assets/main.js - About 40 mins to fix

                    Function constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        constructor(config: IApiConfig) {
                            this.serverAcceptsJSON = true
                            this._uriGenerationMode = false
                            this._httpOptions = {
                                url: config.url,
                    Severity: Minor
                    Found in src/Api.ts - About 35 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

                    Avoid too many return statements within this function.
                    Open

                                                return e.emit(t.QueryLexer.PRESENCE), t.QueryLexer.lexText
                    Severity: Major
                    Found in docs/assets/main.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                              if (r.match(t.QueryLexer.termSeparator)) return t.QueryLexer.lexTerm
                      Severity: Major
                      Found in docs/assets/main.js - About 30 mins to fix

                        Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            get(objCode: string, objIDs: string | string[], fields?: TFields) {
                                if (typeof objIDs === 'string') {
                                    objIDs = [objIDs]
                                }
                                let endPoint = objCode,
                        Severity: Minor
                        Found in src/Api.ts - About 25 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

                        Severity
                        Category
                        Status
                        Source
                        Language