wmakeev/moysklad

View on GitHub
src/tools/buildFilter.js

Summary

Maintainability
F
1 wk
Test Coverage
A
98%

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

      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 src/tools/buildFilter.js and 1 other location - About 2 days to fix
      bundle/umd/moysklad.js on lines 1315..1375

      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 src/tools/buildFilter.js and 1 other location - About 2 days to fix
      bundle/umd/moysklad.js on lines 1377..1437

      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

      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 src/tools/buildFilter.js and 1 other location - About 5 hrs to fix
      bundle/umd/moysklad.js on lines 1270..1282

      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

      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 src/tools/buildFilter.js and 1 other location - About 3 hrs to fix
      bundle/umd/moysklad.js on lines 1255..1267

      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

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

      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

      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 src/tools/buildFilter.js and 1 other location - About 2 hrs to fix
      bundle/umd/moysklad.js on lines 1297..1303

      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

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

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

      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 src/tools/buildFilter.js and 1 other location - About 35 mins to fix
      bundle/umd/moysklad.js on lines 1246..1253

      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

      Replace '~=' with "~="
      Open

        st: { operator: '~=' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.gt.not = selectors.lte
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.nin.not = selectors.in
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                  return [key, operator, getTimeString(value, true)]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '.' with "."
      Open

              `значение селектора ${path.join('.')} должно быть массивом`
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.lt.not = selectors.gte
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$'·+·key]·=·(⏎····op.collection·?·createCollectionSelector·:·createValueSelector⏎··)(op) with "$"·+·key]·=·(op.collection⏎····?·createCollectionSelector⏎····:·createValueSelector)(op);
      Open

        res['$' + key] = (
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        return [fp[0], fp[1].not, fp[2]]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$' with "$"
      Open

          case curKey && curKey.substr(0, 1) === '$' && path.length > 1:
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                  )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace ';' with ";"
      Open

            .join(';')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace './isSimpleValue') with "./isSimpleValue");
      Open

      const isSimpleValue = require('./isSimpleValue')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

          )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$exists:·значение·селектора·должно·быть·логическим·значением' with "$exists:·значение·селектора·должно·быть·логическим·значением"
      Open

                '$exists: значение селектора должно быть логическим значением'
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace with ;
      Open

            return [[path.slice(0, -1), value ? selectors.ne : selectors.eq, null]]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              const value = part[2]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'number' with "number"
      Open

                case typeof value === 'number':
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '=' with "="
      Open

        in: { operator: '=', collection: true },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$all:·значение·селектора·должно·быть·массивом') with ⏎··········"$all:·значение·селектора·должно·быть·массивом"⏎········);
      Open

              throw new MoyskladError('$all: значение селектора должно быть массивом')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$not:·значение·селектора·должно·быть·объектом') with ⏎··········"$not:·значение·селектора·должно·быть·объектом"⏎········);
      Open

              throw new MoyskladError('$not: значение селектора должно быть объектом')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

            return getFilterParts(path.slice(0, -1), value).map(invertFilterPart)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace ''] with ""];
      Open

                  return [key, operator, '']
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                return 1
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

            )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$exists' with "$exists"
      Open

          case curKey === '$exists':
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'string' with "string"
      Open

                case typeof value === 'string': {
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

            )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }, {})
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'boolean' with "boolean"
      Open

            if (typeof value !== 'boolean') {
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

            return [[path, selectors.eq, value]]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        const sel = createValueSelector(selector)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        const op = selectors[key]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace './getTimeString') with "./getTimeString");
      Open

      const getTimeString = require('./getTimeString')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '!=' with "!="
      Open

        ne: { operator: '!=' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '=~' with "=~"
      Open

        et: { operator: '=~' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        selectors[key].name = `$${key}`
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$not' with "$not"
      Open

          case curKey === '$not':
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                  ]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'значение·должно·быть·строкой,·числом,·датой·или·null' with "значение·должно·быть·строкой,·числом,·датой·или·null"
      Open

            'значение должно быть строкой, числом, датой или null'
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '<' with "<"
      Open

        lt: { operator: '<' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.eq.not = selectors.ne
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.ne.not = selectors.eq
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '$all' with "$all"
      Open

          case curKey === '$all':
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        return res
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace './isPlainObject') with "./isPlainObject");
      Open

      const isPlainObject = require('./isPlainObject')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

          return value.reduce((res, v) => res.concat(sel(path, v)), [])
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '!=' with "!="
      Open

        nin: { operator: '!=', collection: true }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'Поле·filter·должно·быть·объектом') with "Поле·filter·должно·быть·объектом");
      Open

          throw new MoyskladError('Поле filter должно быть объектом')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'use·strict' with "use·strict";
      Open

      'use strict'
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '=' with "="
      Open

        eq: { operator: '=' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '~' with "~"
      Open

        contains: { operator: '~' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '../errors') with "../errors");
      Open

      const { MoyskladError } = require('../errors')
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '>=' with ">="
      Open

        gte: { operator: '>=' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              return comparisonSelectors[curKey](path.slice(0, -1), value)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.gte.not = selectors.lt
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              throw new MoyskladError(`${curKey}: ${error.message}`)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              const operator = part[1].operator
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace with ;
      Open

            throw new MoyskladError(`Неизвестный селектор "${curKey}"`)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              const key = part[0]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                  return [key, operator, value]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                return -1
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

              return 0
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

          )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace with ;
      Open

            )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '.'),·part[1],·part[2]]) with "."),·part[1],·part[2]]);
      Open

        filterParts = filterParts.map(part => [part[0].join('.'), part[1], part[2]])
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '>' with ">"
      Open

        gt: { operator: '>' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace '<=' with "<="
      Open

        lte: { operator: '<=' },
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        const curKey = pathLen ? path[pathLen - 1] : null
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Delete
      Open

            }
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace with ;
      Open

            )
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

                  return null
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace ';')·?·value.replaceAll(';',·'\\;' with ";")·?·value.replaceAll(";",·"\\;"
      Open

                    value.includes(';') ? value.replaceAll(';', '\\;') : value
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        return [[path, selector, value]]
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      })
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.lte.not = selectors.gt
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

      selectors.in.not = selectors.nin
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        const pathLen = path.length
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Insert ;
      Open

        let filterParts = getFilterParts([], filter)
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Replace 'boolean' with "boolean"
      Open

                case typeof value === 'boolean':
      Severity: Minor
      Found in src/tools/buildFilter.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      There are no issues that match your filters.

      Category
      Status