<commit_before>import { AnchorButton, Icon, Intent, Popover, Position, Tag, Tooltip } from '@blueprintjs/core'
import _ from 'lodash'
import React from 'react'
import { connect } from 'react-redux'
import { flowEditorRedo, flowEditorUndo, saveAllFlows } from '~/actions'
import { LeftToolbarButtons, RightToolbarButtons, Toolbar } from '~/components/Shared/Interface'
import { canFlowRedo, canFlowUndo } from '~/reducers'
import { getCurrentFlow } from '~/reducers'

import style from './style.scss'

const FlowProblems = props => {
  const highlightNode = node => {
    // @ts-ignore
    window.highlightNode(props.currentFlow && props.currentFlow.name, node)
  }
  const hasProblems = !!props.flowProblems.length

  return (
    <Popover>
      <Tooltip
        content={
          hasProblems ? <span>There are some problems with your flow.<br />Click for more details</span> : <span>No problem with your flow.</span>
        }
        position={Position.BOTTOM}
      >
        {hasProblems ? (
          <Tag icon="error" className={style.flowProblems} intent={Intent.DANGER}>
            {props.flowProblems.length}
          </Tag>
        ) : (
          <Icon icon="info-sign" color="gray" style={{ padding: '5px 5px 0 0' }} />
        )}
      </Tooltip>
      <div style={{ padding: 10 }}>
        {props.flowProblems.map(node => (
          <div key={node.nodeName}>
            <a onClick={() => highlightNode(node.nodeName)}>
              <strong>{node.nodeName}</strong>
            </a>
            : Missing <strong>{node.missingPorts}</strong> links
          </div><commit_msg>removing info when no error<commit_after>import { AnchorButton, Icon, Intent, Popover, Position, Tag, Tooltip } from '@blueprintjs/core'
import _ from 'lodash'
import React from 'react'
import { connect } from 'react-redux'
import { flowEditorRedo, flowEditorUndo, saveAllFlows } from '~/actions'
import { LeftToolbarButtons, RightToolbarButtons, Toolbar } from '~/components/Shared/Interface'
import { canFlowRedo, canFlowUndo } from '~/reducers'
import { getCurrentFlow } from '~/reducers'

import style from './style.scss'

const FlowProblems = props => {
  const highlightNode = node => {
    // @ts-ignore
    window.highlightNode(props.currentFlow && props.currentFlow.name, node)
  }
  const hasProblems = !!props.flowProblems.length

  if (!hasProblems) {
    return null
  }

  return (
    <Popover>
      <Tooltip
        content={
          <span>
            There are some problems with your flow.
            <br />
            Click for more details
          </span>
        }
        position={Position.BOTTOM}
      >
        <Tag icon="error" className={style.flowProblems} intent={Intent.DANGER}>
          {props.flowProblems.length}
        </Tag>
      </Tooltip>
      <div style={{ padding: 10 }}>
        {props.flowProblems.map(node => (
          <div key={node.nodeName}>
            <a onClick={() => highlightNode(node.nodeName)}>
              <strong>{node.nodeName}</strong>
            </a>
            : Missing <strong>{node.missingPorts}</strong> links
          </div>
{'fraction_non_alphanumeric': 0.13301127214170694, 'fraction_numerical': 0.0025764895330112722, 'mean_word_length': 2.6713947990543736, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 48, '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': '4112257', 'n_tokens_mistral': 950, 'n_tokens_neox': 922, 'n_words': 222}