wmakeev/moysklad

View on GitHub
bundle/umd/moysklad.js

Summary

Maintainability
F
1 mo
Test Coverage

File moysklad.js has 1165 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (() => { // webpackBootstrap
/******/     var __webpack_modules__ = ({

/***/ 52:
/***/ ((module) => {
Severity: Major
Found in bundle/umd/moysklad.js - About 2 days to fix

    Function 91 has 227 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    /***/ ((module) => {
    
    "use strict";
    
    
    
    Severity: Major
    Found in bundle/umd/moysklad.js - About 1 day to fix

      Function 656 has 157 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
      
      "use strict";
      
      
      
      Severity: Major
      Found in bundle/umd/moysklad.js - About 6 hrs to fix

        Function 579 has 119 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
        
        "use strict";
        
        
        
        Severity: Major
        Found in bundle/umd/moysklad.js - About 4 hrs to fix

          Function 138 has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
          
          "use strict";
          /*
           * moysklad
          Severity: Major
          Found in bundle/umd/moysklad.js - About 4 hrs to fix

            Function fetchUrl has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = async function fetchUrl(url, options = {}) {
              const requestId = ++globalRequestId
            
              have.strict(arguments, { url: 'url', options: 'opt Object' })
            
            
            Severity: Major
            Found in bundle/umd/moysklad.js - About 4 hrs to fix

              Function 658 has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              /***/ ((module) => {
              
              "use strict";
              
              
              
              Severity: Major
              Found in bundle/umd/moysklad.js - About 2 hrs to fix

                Function ensureArgs has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function ensureArgs (args, schema, matchers, strict) {
                  var ensureResults = []
                  var parsedArgs = {}
                  var argIndex = 0
                  var argsKeys = []
                Severity: Major
                Found in bundle/umd/moysklad.js - About 2 hrs to fix

                  Function 467 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
                  
                  "use strict";
                  
                  
                  
                  Severity: Major
                  Found in bundle/umd/moysklad.js - About 2 hrs to fix

                    Function ensure has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function ensure (matchers, argName, argType, value, check) {
                      var memberType = null
                      var valid = true
                      var reason = null
                      var match = null
                    Severity: Major
                    Found in bundle/umd/moysklad.js - About 2 hrs to fix

                      Function 60 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
                      
                      'use srict'
                      
                      const { MoyskladError } = __webpack_require__(658)
                      Severity: Minor
                      Found in bundle/umd/moysklad.js - About 1 hr to fix

                        Function buildFilter has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function buildFilter(filter) {
                          if (!isPlainObject(filter)) {
                            throw new MoyskladError('Поле filter должно быть объектом')
                          }
                        
                        
                        Severity: Minor
                        Found in bundle/umd/moysklad.js - About 1 hr to fix

                          Function getFilterParts has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getFilterParts(path, value) {
                            const pathLen = path.length
                            const curKey = pathLen ? path[pathLen - 1] : null
                          
                            switch (true) {
                          Severity: Minor
                          Found in bundle/umd/moysklad.js - About 1 hr to fix

                            Function 565 has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            /***/ ((module) => {
                            
                            "use strict";
                            
                            
                            
                            Severity: Minor
                            Found in bundle/umd/moysklad.js - About 1 hr to fix

                              Function parseUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              module.exports = function parseUrl(...args) {
                                const { url, path } = have.strict(args, [
                                  { url: 'url' },
                                  { path: 'str or str arr' }
                                ])
                              Severity: Minor
                              Found in bundle/umd/moysklad.js - About 1 hr to fix

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

                                /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
                                
                                "use strict";
                                
                                
                                
                                Severity: Minor
                                Found in bundle/umd/moysklad.js - About 1 hr to fix

                                  Function buildQuery has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function buildQuery(query) {
                                    // совместимость с remap 1.2
                                    if (query.expand && query.limit == null) {
                                      query.limit = 100
                                    }
                                  Severity: Minor
                                  Found in bundle/umd/moysklad.js - About 1 hr to fix

                                    Function 706 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
                                    
                                    "use strict";
                                    
                                    
                                    
                                    Severity: Minor
                                    Found in bundle/umd/moysklad.js - About 1 hr to fix

                                      Function buildUrl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      module.exports = function buildUrl(...args) {
                                        // eslint-disable-next-line prefer-const
                                        let { url, path, query } = have.strict(args, [
                                          { url: 'url', query: 'opt Object' },
                                          { path: 'str or str arr', query: 'opt Object' },
                                      Severity: Minor
                                      Found in bundle/umd/moysklad.js - About 1 hr to fix

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

                                        module.exports = (function () {
                                          var assert = customAssert
                                        
                                          function have (args, schema, strict) {
                                            var res = ensureArgs(args, schema, this.matchers, strict)
                                        Severity: Minor
                                        Found in bundle/umd/moysklad.js - About 1 hr to fix

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

                                          module.exports = function getAuthHeader() {
                                            let token
                                            let login
                                            let password
                                          
                                          
                                          Severity: Minor
                                          Found in bundle/umd/moysklad.js - About 1 hr to fix

                                            Function 9 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
                                            
                                            "use strict";
                                            
                                            
                                            
                                            Severity: Minor
                                            Found in bundle/umd/moysklad.js - About 1 hr to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                      if (ensured) {
                                                        parsedArgs[argName] = args[argsKeys[argIndex]]
                                                        argIndex++
                                                      }
                                              Severity: Major
                                              Found in bundle/umd/moysklad.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                        if (fail) break
                                                Severity: Major
                                                Found in bundle/umd/moysklad.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                        for (p in args) {
                                                          if (args.hasOwnProperty(p)) { argsKeys[i++] = p }
                                                        }
                                                  Severity: Major
                                                  Found in bundle/umd/moysklad.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                              function (cond, fail_) { if (!cond) fail = fail_ })
                                                    Severity: Major
                                                    Found in bundle/umd/moysklad.js - About 45 mins to fix

                                                      Function ensure has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                      function ensure (matchers, argName, argType, value, check) {
                                                      Severity: Minor
                                                      Found in bundle/umd/moysklad.js - About 35 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                return false
                                                        Severity: Major
                                                        Found in bundle/umd/moysklad.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                            return true
                                                          Severity: Major
                                                          Found in bundle/umd/moysklad.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                return true
                                                            Severity: Major
                                                            Found in bundle/umd/moysklad.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                return null
                                                              Severity: Major
                                                              Found in bundle/umd/moysklad.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                  return result
                                                                Severity: Major
                                                                Found in bundle/umd/moysklad.js - About 30 mins to fix

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

                                                                  module.exports = async function fetchUrl(url, options = {}) {
                                                                    const requestId = ++globalRequestId
                                                                  
                                                                    have.strict(arguments, { url: 'url', options: 'opt Object' })
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 5 days to fix
                                                                  src/methods/fetchUrl.js on lines 14..154

                                                                  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 958.

                                                                  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

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

                                                                  module.exports = stampit({
                                                                    methods: {
                                                                      getAuthHeader,
                                                                  
                                                                      buildUrl,
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 3 days to fix
                                                                  src/index.js on lines 42..159

                                                                  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 626.

                                                                  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

                                                                  function getFilterParts(path, value) {
                                                                    const pathLen = path.length
                                                                    const curKey = pathLen ? path[pathLen - 1] : null
                                                                  
                                                                    switch (true) {
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 days to fix
                                                                  src/tools/buildFilter.js on lines 77..137

                                                                  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 496.

                                                                  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

                                                                  module.exports = function buildFilter(filter) {
                                                                    if (!isPlainObject(filter)) {
                                                                      throw new MoyskladError('Поле filter должно быть объектом')
                                                                    }
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 days to fix
                                                                  src/tools/buildFilter.js on lines 139..199

                                                                  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 413.

                                                                  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

                                                                  module.exports = function parseUrl(...args) {
                                                                    const { url, path } = have.strict(args, [
                                                                      { url: 'url' },
                                                                      { path: 'str or str arr' }
                                                                    ])
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 days to fix
                                                                  src/methods/parseUrl.js on lines 11..59

                                                                  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 367.

                                                                  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

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

                                                                  module.exports = function buildQuery(query) {
                                                                    // совместимость с remap 1.2
                                                                    if (query.expand && query.limit == null) {
                                                                      query.limit = 100
                                                                    }
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 days to fix
                                                                  src/tools/buildQuery.js on lines 21..66

                                                                  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 357.

                                                                  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

                                                                  module.exports = function buildUrl(...args) {
                                                                    // eslint-disable-next-line prefer-const
                                                                    let { url, path, query } = have.strict(args, [
                                                                      { url: 'url', query: 'opt Object' },
                                                                      { path: 'str or str arr', query: 'opt Object' },
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 day to fix
                                                                  src/methods/buildUrl.js on lines 9..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 312.

                                                                  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

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

                                                                  module.exports = function parseQueryString(queryString) {
                                                                    if (queryString == null || queryString === '') {
                                                                      return undefined
                                                                    }
                                                                    queryString = queryString.trim()
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 day to fix
                                                                  src/tools/parseQueryString.js on lines 26..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 252.

                                                                  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

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

                                                                  module.exports = function parseTimeString(timeString) {
                                                                    // 2017-04-08 13:33:00.123
                                                                    const m = MS_TIME_REGEX.exec(timeString)
                                                                    if (!m || m.length < 7 || m.length > 8) {
                                                                      throw new MoyskladError(`Некорректный формат даты "${timeString}"`)
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 day to fix
                                                                  src/tools/parseTimeString.js on lines 21..35

                                                                  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 220.

                                                                  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

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

                                                                  module.exports = function getAuthHeader() {
                                                                    let token
                                                                    let login
                                                                    let password
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 day to fix
                                                                  src/methods/getAuthHeader.js on lines 16..53

                                                                  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 214.

                                                                  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

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

                                                                  module.exports = function getResponseError(responseBody, response) {
                                                                    if (!responseBody) return null
                                                                  
                                                                    if (Array.isArray(responseBody)) {
                                                                      const errorsIndexes = responseBody
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 day to fix
                                                                  src/getResponseError.js on lines 5..31

                                                                  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 206.

                                                                  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

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

                                                                  module.exports = function POST(...args) {
                                                                    // TODO Test payload: 'Object or Object arr'
                                                                    const {
                                                                      path,
                                                                      payload,
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 7 hrs to fix
                                                                  src/methods/POST.js on lines 5..31

                                                                  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 178.

                                                                  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

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

                                                                  module.exports = function PUT(...args) {
                                                                    const {
                                                                      path,
                                                                      payload,
                                                                      query,
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 7 hrs to fix
                                                                  src/methods/PUT.js on lines 5..30

                                                                  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 176.

                                                                  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

                                                                  class MoyskladApiError extends MoyskladRequestError {
                                                                    constructor(errors, response) {
                                                                      const error = errors[0]
                                                                      /* c8 ignore next */
                                                                      const message = error.error + (error.moreInfo ? ` (${error.moreInfo})` : '')
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 6 hrs to fix
                                                                  src/errors.js on lines 45..59

                                                                  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 174.

                                                                  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

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

                                                                  module.exports = function getTimeString(date, includeMs) {
                                                                    const mskTime = new Date(+date + mskTimezone + timezoneFix)
                                                                  
                                                                    const milliseconds = mskTime.getUTCMilliseconds()
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 6 hrs to fix
                                                                  src/tools/getTimeString.js on lines 25..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 167.

                                                                  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

                                                                  module.exports = function getTimezoneShift() {
                                                                    const localTimeZoneOffset = -(new Date().getTimezoneOffset() * 60 * 1000)
                                                                  
                                                                    /** Локальная временная зона в мс */
                                                                    let timeZoneMs = localTimeZoneOffset
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 5 hrs to fix
                                                                  src/tools/getTimezoneShift.js on lines 8..31

                                                                  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 151.

                                                                  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

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

                                                                  const selectors = {
                                                                    eq: { operator: '=' },
                                                                    gt: { operator: '>' },
                                                                    gte: { operator: '>=' },
                                                                    lt: { operator: '<' },
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 5 hrs to fix
                                                                  src/tools/buildFilter.js on lines 32..44

                                                                  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 141.

                                                                  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

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

                                                                  class MoyskladUnexpectedRedirectError extends MoyskladRequestError {
                                                                    constructor(response) {
                                                                      super(
                                                                        `Неожиданное перенаправление запроса с кодом ${response.status}` +
                                                                          ' (см. подробнее https://github.com/wmakeev/moysklad#moyskladunexpectedredirecterror)',
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 4 hrs to fix
                                                                  src/errors.js on lines 26..43

                                                                  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 124.

                                                                  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

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

                                                                  module.exports = function GET(...args) {
                                                                    const {
                                                                      path,
                                                                      query,
                                                                      options = {}
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 4 hrs to fix
                                                                  src/methods/GET.js on lines 5..18

                                                                  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 117.

                                                                  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

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

                                                                  const addQueryPart = (res, key) => val => {
                                                                    if (val === null) {
                                                                      res.push([key, ''])
                                                                    } else if (val === undefined) {
                                                                      return undefined
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 4 hrs to fix
                                                                  src/tools/buildQuery.js on lines 7..19

                                                                  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 115.

                                                                  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

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

                                                                  module.exports = function DELETE(...args) {
                                                                    const { path, options = {} } = have.strict(args, [
                                                                      { path: 'str or str arr', options: 'opt Object' },
                                                                      have.argumentsObject
                                                                    ])
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 3 hrs to fix
                                                                  src/methods/DELETE.js on lines 5..14

                                                                  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 106.

                                                                  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

                                                                  const createCollectionSelector = selector => {
                                                                    const sel = createValueSelector(selector)
                                                                  
                                                                    return (path, value) => {
                                                                      if (!(value instanceof Array)) {
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 3 hrs to fix
                                                                  src/tools/buildFilter.js on lines 17..29

                                                                  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 104.

                                                                  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

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

                                                                  function extractQueryValue(str) {
                                                                    if (str === '') {
                                                                      return null
                                                                    }
                                                                    const asBool = Boolean(str)
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/tools/parseQueryString.js on lines 3..18

                                                                  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 94.

                                                                  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

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

                                                                  class MoyskladError extends Error {
                                                                    constructor(message, ...args) {
                                                                      super(message, ...args)
                                                                      this.name = this.constructor.name
                                                                      /* c8 ignore else  */
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/errors.js on lines 3..12

                                                                  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 80.

                                                                  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

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

                                                                  const invertFilterPart = fp => {
                                                                    if (!fp[1].not) {
                                                                      throw new MoyskladError(
                                                                        `${fp[1].name} не поддерживает селектор отрицания $not`
                                                                      )
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/tools/buildFilter.js on lines 68..75

                                                                  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 79.

                                                                  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

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

                                                                  function getApiDefaultVersion(api) {
                                                                    const apiVersion = DEFAULT_VERSIONS[api]
                                                                    const envKey = ENV_KEY[api] || api.replace(/\W/g, '_').toUpperCase()
                                                                    const envName = `MOYSKLAD_${envKey}_API_VERSION`
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/getApiDefaultVersion.js on lines 19..25

                                                                  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 78.

                                                                  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

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

                                                                  class MoyskladRequestError extends MoyskladError {
                                                                    constructor(message, response) {
                                                                      super(message)
                                                                  
                                                                      if (response) {
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/errors.js on lines 14..24

                                                                  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 77.

                                                                  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

                                                                  const comparisonSelectors = Object.keys(selectors).reduce((res, key) => {
                                                                    const op = selectors[key]
                                                                    res['$' + key] = (
                                                                      op.collection ? createCollectionSelector : createValueSelector
                                                                    )(op)
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 2 hrs to fix
                                                                  src/tools/buildFilter.js on lines 59..65

                                                                  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 77.

                                                                  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

                                                                    'Moysklad.Collection': col =>
                                                                      !!(
                                                                        col &&
                                                                        col.meta &&
                                                                        col.meta.type &&
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 hr to fix
                                                                  src/matchers.js on lines 26..33

                                                                  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 64.

                                                                  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

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

                                                                  function extractQueryValues(str) {
                                                                    return str.indexOf(',') !== -1
                                                                      ? str.split(',').map(v => extractQueryValue(v))
                                                                      : [extractQueryValue(str)]
                                                                  }
                                                                  Severity: Major
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 1 hr to fix
                                                                  src/tools/parseQueryString.js on lines 20..24

                                                                  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 62.

                                                                  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

                                                                    'entity': ent =>
                                                                      !!(ent && ent.id && uuidMatcher(ent.id) && ent.meta && ent.meta.type),
                                                                  Severity: Minor
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 55 mins to fix
                                                                  src/matchers.js on lines 13..14

                                                                  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 53.

                                                                  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

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

                                                                  Object.keys(selectors).forEach(key => {
                                                                    selectors[key].name = `$${key}`
                                                                  })
                                                                  Severity: Minor
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 40 mins to fix
                                                                  src/tools/buildFilter.js on lines 46..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 49.

                                                                  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

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

                                                                  const createValueSelector = selector => (path, value) => {
                                                                    if (!isSimpleValue(value)) {
                                                                      throw new MoyskladError(
                                                                        'значение должно быть строкой, числом, датой или null'
                                                                      )
                                                                  Severity: Minor
                                                                  Found in bundle/umd/moysklad.js and 1 other location - About 35 mins to fix
                                                                  src/tools/buildFilter.js on lines 8..15

                                                                  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 47.

                                                                  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

                                                                  There are no issues that match your filters.

                                                                  Category
                                                                  Status