huridocs/uwazi

View on GitHub
app/react/Metadata/components/ShowMetadata.js

Summary

Maintainability
A
35 mins
Test Coverage
A
100%

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

  render() {
    const { entity, showTitle, showType, relationships, showSubset, groupGeolocations } =
      this.props;
    let header = '';
    if (showTitle || showType) {
Severity: Minor
Found in app/react/Metadata/components/ShowMetadata.js - 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

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

import ShowIf from 'app/App/ShowIf';

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

Prop type "any" is forbidden
Open

  relationships: PropTypes.any,

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

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

  relationships: PropTypes.any,

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

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

  entity: PropTypes.object,

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

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

  showType: PropTypes.bool,

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

Prop type "object" is forbidden
Open

  entity: PropTypes.object,

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

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

  templates: PropTypes.object,

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

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

  showTitle: PropTypes.bool,

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

Prefer named exports.
Open

export default connect(mapStateToProps)(ShowMetadata);

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

Prop type "object" is forbidden
Open

  templates: PropTypes.object,

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

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

  templates: PropTypes.object,

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

There are no issues that match your filters.

Category
Status