<commit_before>import React from 'react';
import Websocket from 'react-websocket';
import queryString from "query-string";
import {Alert} from "react-bootstrap";
import ItemRow from "./itemRow";


class LiveFeed extends React.Component {

  constructor(props) {
    super(props);
    this.localRows = props.localRows;
    this.state = {rows : 0};
    this.countLinks = this.countLinks.bind(this);
  }
    countLinks(stashItem) {
        let a;
        if (stashItem.Item.sockets){
            a = stashItem.Item.sockets.reduce(function (agg, curr) {
                agg[curr.group] ? agg[curr.group]++ : agg[curr.group] = 1;
                return agg
            }, {})
        }else {
            return null;
        }
        return a;
    }
    handleData(data) {
      let result;
      try{
          result = JSON.parse(data);
      } catch(e){
          console.log(e);
          console.log(data);
      }
        //FOR DEBUGGING ONLY
        if (result/* && this.localRows.length < 5*/){
            result.Item.links = this.countLinks(result);
            this.localRows.unshift(<ItemRow item={result} key={this.localRows.length} index={this.localRows.length}/>)
            this.setState({
                rows: this.localRows.length
            });
        }
    }

    render() {
        if (!this.props.form){
            return null;<commit_msg>Added all properties Added link and socket search<commit_after>import React from 'react';
import Websocket from 'react-websocket';
import queryString from "query-string";
import {Alert} from "react-bootstrap";
import ItemRow from "./itemRow";


class LiveFeed extends React.Component {

  constructor(props) {
    super(props);
    this.localRows = props.localRows;
    this.state = {rows : 0};
    this.countLinks = this.countLinks.bind(this);
  }
    countLinks(stashItem) {
        let a;
        if (stashItem.Item.sockets){
            a = stashItem.Item.sockets.reduce(function (agg, curr) {
                agg[curr.group] ? agg[curr.group]++ : agg[curr.group] = 1;
                return agg
            }, {})
        }else {
            return null;
        }
        return a;
    }
    handleData(data) {
      let result;
      try{
          result = JSON.parse(data);
      } catch(e){
          console.log(e);
          console.log(data);
      }
        //FOR DEBUGGING ONLY
        if (result/* && this.localRows.length < 5*/){
            result.Item.links = this.countLinks(result);
            this.localRows.unshift(<ItemRow item={result} key={this.localRows.length} index={this.localRows.length}/>);
            this.setState({
                rows: this.localRows.length
            });
        }
    }

    render() {
        if (!this.props.form){
            return null;
{'fraction_non_alphanumeric': 0.1307497283592901, 'fraction_numerical': 0.0021731256791017745, 'mean_word_length': 1.919661733615222, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2105415', 'n_tokens_mistral': 841, 'n_tokens_neox': 814, 'n_words': 172}