N3-components/N3-components

View on GitHub

Showing 20 of 39 total issues

File node.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { markNodeData, NODE_KEY } from './util'

const objectAssign = Object.assign

const reInitChecked = function (node) {
Severity: Minor
Found in src/tree/model/node.js - About 3 hrs to fix

    Store has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class Store {
      constructor (options) {
        this.currentNode = null
        this.currentNodeKey = null
    
    
    Severity: Minor
    Found in src/tree/model/store.js - About 2 hrs to fix

      Function alert has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const alert = (options) => {
        const {title, message, effect, type, width, onConfirm, onHide, onShow} = options
        const alert = new Vue({
          el: createNode(),
          mixins: [localeMixin('n3Modal')],
      Severity: Major
      Found in src/Modal/n3ModalMethod.js - About 2 hrs to fix

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

          constructor (options) {
            this.id = nodeIdSeed++
            this.text = null
            this.checked = false
            this.indeterminate = false
        Severity: Minor
        Found in src/tree/model/node.js - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function confirm has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const confirm = (options) => {
          const {title, message, effect, type, width, onConfirm, onHide, onShow} = options
          const confirm = new Vue({
            el: createNode(),
            data () {
        Severity: Major
        Found in src/Modal/n3ModalMethod.js - About 2 hrs to fix

          Function constructor has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor (options) {
              this.id = nodeIdSeed++
              this.text = null
              this.checked = false
              this.indeterminate = false
          Severity: Major
          Found in src/tree/model/node.js - About 2 hrs to fix

            Function alert has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const alert = (options) => {
              const {description, type, dismissable, duration, width, small, placement, message, content, icon} = options
              let containerClass = 'n3-alert-container-' + (placement || 'top')
              let container = document.querySelector('.' + containerClass)
            
            
            Severity: Major
            Found in src/Alert/n3AlertMethod.js - About 2 hrs to fix

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

                mounted () {
                  if (!this.$refs.popover) return
              
                  this.$nextTick(() => {
                    let popover = this.$refs.popover
              Severity: Minor
              Found in src/Mixin/popoverMixin.js - About 1 hr to fix

                Function reInitChecked has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                const reInitChecked = function (node) {
                  const siblings = node.childNodes
                
                  let all = true
                  let none = true
                Severity: Minor
                Found in src/tree/model/node.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 setChecked has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  setChecked (value, deep) {
                    this.indeterminate = value === 'half'
                    this.checked = value === true
                
                    const handleDescendants = () => {
                Severity: Minor
                Found in src/tree/model/node.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 filter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                  filter (value) {
                    const filterNodeMethod = this.filterNodeMethod
                    const traverse = function (node) {
                      const childNodes = node.root ? node.root.childNodes : node.childNodes
                
                
                Severity: Minor
                Found in src/tree/model/store.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 resize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    resize () {
                      let popover = this.$refs.popover
                      let triger = this.$refs.trigger.children[0]
                      popover.style.display = 'block'
                      triger.style.position = 'relative'
                Severity: Minor
                Found in src/Mixin/popoverMixin.js - About 1 hr to fix

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

                    expand (callback, expandParent) {
                      const done = () => {
                        if (expandParent) {
                          let parent = this.parent
                          while (parent.level > 0) {
                  Severity: Minor
                  Found in src/tree/model/node.js - About 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function loadData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    loadData (callback, defaultProps = {}) {
                      if (this.store.lazy === true && this.store.load && !this.loaded && !this.loading) {
                        this.loading = true
                  
                        const resolve = (children) => {
                  Severity: Minor
                  Found in src/tree/model/node.js - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function calPosition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const calPosition = function (el) {
                      let w = el.offsetWidth
                      let h = el.offsetHeight
                      let x = getLeft(el) - document.body.scrollLeft
                      let y = getTop(el) - document.body.scrollTop
                  Severity: Minor
                  Found in src/position.js - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      dispatch (componentName, eventName, params) {
                        var parent = this.$parent || this.$root
                        var name = parent.$options.name
                  
                        while (parent && (!name || name !== componentName)) {
                  Severity: Minor
                  Found in src/utils/events.js - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                  const alert = (options) => {
                    const {description, type, dismissable, duration, width, small, placement, message, content, icon} = options
                    let containerClass = 'n3-alert-container-' + (placement || 'top')
                    let container = document.querySelector('.' + containerClass)
                  
                  
                  Severity: Minor
                  Found in src/Alert/n3AlertMethod.js - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      dispatch(componentName, eventName, params) {
                        var parent = this.$parent || this.$root;
                        var name = parent.$options.componentName;
                  
                        while (parent && (!name || name !== componentName)) {
                  Severity: Minor
                  Found in src/Mixin/eventMixin.js - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                    setData (data) {
                      if (!Array.isArray(data)) {
                        markNodeData(this, data)
                      }
                  
                  
                  Severity: Minor
                  Found in src/tree/model/node.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                    constructor (options) {
                      this.currentNode = null
                      this.currentNodeKey = null
                  
                      for (let option in options) {
                  Severity: Minor
                  Found in src/tree/model/store.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language