saarnilauri/fida-imu

View on GitHub

Showing 22 of 105 total issues

Function getEntityAdminPage has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getEntityAdminPage = (entity, settings) => {
  const wordForms = getWordForms(entity)
  class EntityListPage extends Component {
    constructor(props) {
      super(props)
Severity: Major
Found in src/components/hoc/getEntityAdminPage.js - About 4 hrs to fix

Function getEntityImageDropZone has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getEntityImageDropZone = (
  entity,
  multiple = false,
  authUserUid = null,
) => {
Severity: Major
Found in src/components/hoc/getEntityImageDropZone.js - About 3 hrs to fix

Function getEntityList has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getEntityList = (entity, settings) => {
  const wordForms = getWordForms(entity)
  class EntityList extends Component {
    constructor(props) {
      super(props)
Severity: Major
Found in src/components/hoc/getEntityList.js - About 2 hrs to fix

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

  render() {
    const topHeaderId = `topHeader${camelCase(deburr(this.props.sysName))}`
    const midHeaderId = `midHeader${camelCase(deburr(this.props.sysName))}`
    const botHeaderId = `botHeader${camelCase(deburr(this.props.sysName))}`

Severity: Major
Found in src/components/ResultsChain/Column/index.js - About 2 hrs to fix

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

  render() {
    const { area, name, code, error, editMode } = this.state
    const { formatMessage } = this.props.intl
    return (
      <React.Fragment>
Severity: Major
Found in src/components/Country/List/Page.js - About 2 hrs to fix

Function getEntityAdminPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const getEntityAdminPage = (entity, settings) => {
  const wordForms = getWordForms(entity)
  class EntityListPage extends Component {
    constructor(props) {
      super(props)
Severity: Minor
Found in src/components/hoc/getEntityAdminPage.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 render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
      const mappedSchema = mapSourcesToSchema(
        this.props.sources, // eslint-disable-line react/prop-types
        settings.form.schema,
      )
Severity: Minor
Found in src/components/hoc/getEntityAdminPage.js - About 1 hr to fix

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

  render() {
    const { formatMessage } = this.props.intl
    return (
      <Card
        noBody
Severity: Minor
Found in src/components/Prayer/RecentPrayers/index.js - About 1 hr to fix

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

const EntityListView = props => {
  const {
    formatMessage,
    data,
    tableColumns,
Severity: Minor
Found in src/components/hoc/EntityListView.js - About 1 hr to fix

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

  render() {
    const modules = {
      toolbar: [
        ['bold', 'italic', 'underline', { header: 1 }],
        [{ list: 'ordered' }, { list: 'bullet' }],
Severity: Minor
Found in src/components/QuillEditor/index.js - About 1 hr to fix

Function getEntitySelect has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getEntitySelect = entity => {
  class EntitySelect extends Component {
    render() {
      const { ready, data, onChange, value } = this.props
      const { formatMessage } = this.props.intl
Severity: Minor
Found in src/components/hoc/getEntitySelect.js - About 1 hr to fix

Function withEntities has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const withEntities = entity => WrappedComponent => {
  const wordForms = getWordForms(entity)
  const loadEntities = getLoadEntityCollectionActionCreator(entity)

  const mapDispatchToProps = dispatch => ({
Severity: Minor
Found in src/components/hoc/withEntities.js - About 1 hr to fix

Function LandingPage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LandingPage = () => {
  return (
    <React.Fragment>
      <div className="landing-bg">
        <Row className="full-height d-flex justify-content-center align-items-center">
Severity: Minor
Found in src/components/Landing/index.js - About 1 hr to fix

Function LanguageMenu has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LanguageMenu = props => {
  const { setLocale, history } = props
  return (
    <AppHeaderDropdown direction="down">
      <DropdownToggle nav>
Severity: Minor
Found in src/components/LanguageSwitch/Menu.js - About 1 hr to fix

Function AccountPage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AccountPage = props => {
  const ImageDropZone = getEntityImageDropZone(
    'user',
    false,
    props.authUser.uid,
Severity: Minor
Found in src/components/Account/index.js - About 1 hr to fix

Function setTableSettings has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setTableSettings() {
    const { formatMessage } = this.props.intl
    this.tableColumns = [
      {
        Header: formatMessage({ id: 'user.list.table.header.username' }),
Severity: Minor
Found in src/components/User/List/index.js - About 1 hr to fix

Function setTableSettings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setTableSettings() {
    const { formatMessage } = this.props.intl
    this.tableColumns = [
      {
        id: 'flag',
Severity: Minor
Found in src/components/Country/List/index.js - About 1 hr to fix

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

const getEntityForm = (entity, formSetup, schema) => {
  class EntityForm extends Component {
    render() {
      const { onSubmit, formData, editMode, cancelEdit } = this.props
      const { formatMessage } = this.props.intl
Severity: Minor
Found in src/components/hoc/getEntityForm.js - About 1 hr to fix

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

const withAuthorization = (condition, profileCondition = null) => Component => {
  class WithAuthorization extends React.Component {
    componentDidMount() {
      if (profileCondition !== null && !profileCondition(this.props.profile)) {
        this.props.history.push(routes.NOT_ALLOWED)
Severity: Minor
Found in src/components/Session/withAuthorization.js - About 1 hr to fix

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

    render() {
      const { error, isProcessing } = this.state
      const displayDropzone =
        multiple || (!multiple && !this.props.uploadedFiles)
      return (
Severity: Minor
Found in src/components/hoc/getEntityImageDropZone.js - About 1 hr to fix
Severity
Category
Status
Source
Language