Workfront/workfront-api

View on GitHub

Showing 63 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

      Similar blocks of code found in 2 locations. 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: Major
      Found in docs/assets/main.js and 1 other location - About 1 day to fix
      docs/assets/main.js on lines 1535..1565

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 345.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. 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: Major
      Found in docs/assets/main.js and 1 other location - About 1 day to fix
      docs/assets/main.js on lines 1504..1534

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 345.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        instance.login('new@user.attask', 'user').then(
            function(data) {
                util.log('Creating new project ...');
                instance.create('proj', {name: 'API Project', description: 'This project has been created using API'}).then(
                    function(data) {
        Severity: Major
        Found in examples/node/create-new-project.js and 1 other location - About 1 day to fix
        examples/node/always-use-get.js on lines 32..50

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 199.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        instance.login('new@user.attask', 'user').then(
            function (data) {
                util.log('Creating new project using a GET request...');
                instance.create('proj', {name: 'API Project', description: 'This project has been created using API'}).then(
                    function (data) {
        Severity: Major
        Found in examples/node/always-use-get.js and 1 other location - About 1 day to fix
        examples/node/create-new-project.js on lines 33..51

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 199.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      instance.report('hour', query).then(
                          function(data) {
                              util.log('Report success. Received data:');
                              console.log(util.inspect(data, {colors:true}));
                          },
              Severity: Major
              Found in examples/node/report-project-hours.js and 1 other location - About 3 hrs to fix
              examples/node/get-user-count.js on lines 39..48

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      instance.namedQuery('work', 'myWork').then(
                          function(data) {
                              util.log('Query success. Received data:');
                              console.log(util.inspect(data, {colors:true}));
                          },
              Severity: Major
              Found in examples/node/named-query.js and 1 other location - About 3 hrs to fix
              examples/node/login.js on lines 31..40

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              instance.login('new@user.attask', 'user').then(
                  function(data) {
                      util.log('Login success. Received data:');
                      console.log(util.inspect(data, {colors:true}));
                  },
              Severity: Major
              Found in examples/node/login.js and 1 other location - About 3 hrs to fix
              examples/node/named-query.js on lines 36..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      instance.count('user', query).then(
                          function(data) {
                              util.log('Get success. Received data:');
                              console.log(util.inspect(data, {colors:true}));
                          },
              Severity: Major
              Found in examples/node/get-user-count.js and 1 other location - About 3 hrs to fix
              examples/node/report-project-hours.js on lines 40..49

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        if (((h = q), h.test(c))) {
                                            var L = h.exec(c)
                                            ;(v = L[1]), (C = L[2]), (h = m), h.test(v) && (c = v + r[C])
                                        }
                Severity: Major
                Found in docs/assets/main.js and 1 other location - About 2 hrs to fix
                docs/assets/main.js on lines 441..444

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 89.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        if (((h = j), h.test(c))) {
                                            var L = h.exec(c)
                                            ;(v = L[1]), (C = L[2]), (h = m), h.test(v) && (c = v + e[C])
                                        }
                Severity: Major
                Found in docs/assets/main.js and 1 other location - About 2 hrs to fix
                docs/assets/main.js on lines 445..448

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 89.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                    Severity
                    Category
                    Status
                    Source
                    Language