huridocs/uwazi

View on GitHub
app/react/Viewer/components/Viewer.js

Summary

Maintainability
A
2 hrs
Test Coverage
B
83%

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

  render() {
    const {
      doc,
      sidepanelTab,
      targetDoc,
Severity: Minor
Found in app/react/Viewer/components/Viewer.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

propType "pageText" is not required, but has no corresponding defaultProps declaration.
Open

  pageText: PropTypes.string,

For more information visit Source: http://eslint.org/docs/rules/

propType "addReference" is not required, but has no corresponding defaultProps declaration.
Open

  addReference: PropTypes.func,

For more information visit Source: http://eslint.org/docs/rules/

propType "panelIsOpen" is not required, but has no corresponding defaultProps declaration.
Open

  panelIsOpen: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

propType "selectedConnection" is not required, but has no corresponding defaultProps declaration.
Open

  selectedConnection: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

'locale' PropType is defined but prop is never used
Open

  locale: PropTypes.string.isRequired,

For more information visit Source: http://eslint.org/docs/rules/

Prop type "object" is forbidden
Open

  selectedConnectionMetadata: PropTypes.object,

For more information visit Source: http://eslint.org/docs/rules/

propType "toggleReferences" is not required, but has no corresponding defaultProps declaration.
Open

  toggleReferences: PropTypes.func,

For more information visit Source: http://eslint.org/docs/rules/

Definition for rule 'node/no-restricted-import' was not found.
Open

/* eslint-disable max-lines */

For more information visit Source: http://eslint.org/docs/rules/

propType "sidepanelTab" is not required, but has no corresponding defaultProps declaration.
Open

  sidepanelTab: PropTypes.string,

For more information visit Source: http://eslint.org/docs/rules/

propType "showTextSelectMenu" is not required, but has no corresponding defaultProps declaration.
Open

  showTextSelectMenu: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

propType "targetDoc" is not required, but has no corresponding defaultProps declaration.
Open

  targetDoc: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

propType "showTab" is not required, but has no corresponding defaultProps declaration.
Open

  showTab: PropTypes.func,

For more information visit Source: http://eslint.org/docs/rules/

'selectedConnection' PropType is defined but prop is never used
Open

  selectedConnection: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

propType "selectedConnectionMetadata" is not required, but has no corresponding defaultProps declaration.
Open

  selectedConnectionMetadata: PropTypes.object,

For more information visit Source: http://eslint.org/docs/rules/

propType "showConnections" is not required, but has no corresponding defaultProps declaration.
Open

  showConnections: PropTypes.bool,

For more information visit Source: http://eslint.org/docs/rules/

Prop type "object" is forbidden
Open

  file: PropTypes.object,

For more information visit Source: http://eslint.org/docs/rules/

'selectedConnectionMetadata' PropType is defined but prop is never used
Open

  selectedConnectionMetadata: PropTypes.object,

For more information visit Source: http://eslint.org/docs/rules/

Prop type "object" is forbidden
Open

  store: PropTypes.object,

For more information visit Source: http://eslint.org/docs/rules/

propType "loadTargetDocument" is not required, but has no corresponding defaultProps declaration.
Open

  loadTargetDocument: PropTypes.func,

For more information visit Source: http://eslint.org/docs/rules/

There are no issues that match your filters.

Category
Status