vigetlabs/ars-arsenal

View on GitHub

Showing 7 of 49 total issues

Function render has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { items, multiselect, sort, onKeyDown, onPicked } = this.props

    let ids = items.map((record: Record) => record.id)
    let selected = ids.filter(this.isPicked, this)
Severity: Major
Found in src/components/table-view/index.tsx - About 2 hrs to fix

    Function renderRow has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      renderRow(item: Record, index: number, list: Record[]) {
        const { id, name, attribution, caption, url, tags } = item
        const { multiselect, onPicked, onTagClick } = this.props
    
        let animationDelay = itemAnimationDelay(index) + 'ms'
    Severity: Minor
    Found in src/components/table-view/index.tsx - About 1 hr to fix

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

        renderItems(data: Record[], fetching: boolean) {
          const { columns, multiselect } = this.props
          const { mode, picked, queriedSearch, sort } = this.state
      
          if (data.length === 0) {
      Severity: Minor
      Found in src/components/picker.tsx - About 1 hr to fix

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

          getItem(record: Record, index: number, list: Record[]) {
            const { onPicked } = this.props
        
            let isPicked = this.isPicked(record.id)
            let delay = Math.max(0, itemAnimationDelay(index) - this.offset)
        Severity: Minor
        Found in src/components/gallery.tsx - About 1 hr to fix

          Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { resource, ids, onEdit, onClear } = this.props
          
              let hasPicked = ids.length
          
          
          Severity: Minor
          Found in src/components/multiselection.tsx - About 1 hr to fix

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

              render() {
                let { search, autoComplete, data } = this.props
                let inputId = `ars_search_${this.id}`
                let listId = `ars_search_list_${this.id}`
            
            
            Severity: Minor
            Found in src/components/search.tsx - About 1 hr to fix

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

                accumulate(requests: Request[]): Record[] {
                  let data = []
                  let newContent = requests.some(request => request.valid && !request.fetching)
              
                  for (var i = 0; i < requests.length; i += 1) {
              Severity: Minor
              Found in src/containers/load-collection.tsx - 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

              Severity
              Category
              Status
              Source
              Language