wmakeev/moysklad

View on GitHub

Showing 50 of 537 total issues

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 fetchUrl has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

        module.exports = async function fetchUrl(url, options = {}) {
          const requestId = ++globalRequestId
        
          have.strict(arguments, { url: 'url', options: 'opt Object' })
        
        
        Severity: Minor
        Found in src/methods/fetchUrl.js - About 5 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function 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 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 src/methods/fetchUrl.js - About 4 hrs to fix

                Function showErrors has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function showErrors() {
                  //#region (1) MoyskladError
                  try {
                    await ms.GET('entity/product', {
                      filter: 123
                Severity: Major
                Found in examples/errors.js - About 3 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 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 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 src/tools/buildFilter.js - About 1 hr 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 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 src/tools/buildFilter.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 getFilterParts has a Cognitive Complexity of 14 (exceeds 5 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 src/tools/buildFilter.js - About 1 hr to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Function 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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language