Showing 22 of 105 total issues
Function getEntityAdminPage
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getEntityAdminPage = (entity, settings) => {
const wordForms = getWordForms(entity)
class EntityListPage extends Component {
constructor(props) {
super(props)
- Create a ticketCreate a ticket
Function getEntityImageDropZone
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getEntityImageDropZone = (
entity,
multiple = false,
authUserUid = null,
) => {
- Create a ticketCreate a ticket
Function getEntityList
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getEntityList = (entity, settings) => {
const wordForms = getWordForms(entity)
class EntityList extends Component {
constructor(props) {
super(props)
- Create a ticketCreate a ticket
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))}`
- Create a ticketCreate a ticket
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { area, name, code, error, editMode } = this.state
const { formatMessage } = this.props.intl
return (
<React.Fragment>
- Create a ticketCreate a ticket
Function getEntityAdminPage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
const getEntityAdminPage = (entity, settings) => {
const wordForms = getWordForms(entity)
class EntityListPage extends Component {
constructor(props) {
super(props)
- Read upRead up
- Create a ticketCreate a ticket
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
Open
render() {
const mappedSchema = mapSourcesToSchema(
this.props.sources, // eslint-disable-line react/prop-types
settings.form.schema,
)
- Create a ticketCreate a ticket
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { formatMessage } = this.props.intl
return (
<Card
noBody
- Create a ticketCreate a ticket
Function EntityListView
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EntityListView = props => {
const {
formatMessage,
data,
tableColumns,
- Create a ticketCreate a ticket
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const modules = {
toolbar: [
['bold', 'italic', 'underline', { header: 1 }],
[{ list: 'ordered' }, { list: 'bullet' }],
- Create a ticketCreate a ticket
Function getEntitySelect
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getEntitySelect = entity => {
class EntitySelect extends Component {
render() {
const { ready, data, onChange, value } = this.props
const { formatMessage } = this.props.intl
- Create a ticketCreate a ticket
Function withEntities
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const withEntities = entity => WrappedComponent => {
const wordForms = getWordForms(entity)
const loadEntities = getLoadEntityCollectionActionCreator(entity)
const mapDispatchToProps = dispatch => ({
- Create a ticketCreate a ticket
Function LandingPage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LandingPage = () => {
return (
<React.Fragment>
<div className="landing-bg">
<Row className="full-height d-flex justify-content-center align-items-center">
- Create a ticketCreate a ticket
Function LanguageMenu
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LanguageMenu = props => {
const { setLocale, history } = props
return (
<AppHeaderDropdown direction="down">
<DropdownToggle nav>
- Create a ticketCreate a ticket
Function AccountPage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AccountPage = props => {
const ImageDropZone = getEntityImageDropZone(
'user',
false,
props.authUser.uid,
- Create a ticketCreate a ticket
Function setTableSettings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setTableSettings() {
const { formatMessage } = this.props.intl
this.tableColumns = [
{
Header: formatMessage({ id: 'user.list.table.header.username' }),
- Create a ticketCreate a ticket
Function setTableSettings
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setTableSettings() {
const { formatMessage } = this.props.intl
this.tableColumns = [
{
id: 'flag',
- Create a ticketCreate a ticket
Function getEntityForm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getEntityForm = (entity, formSetup, schema) => {
class EntityForm extends Component {
render() {
const { onSubmit, formData, editMode, cancelEdit } = this.props
const { formatMessage } = this.props.intl
- Create a ticketCreate a ticket
Function withAuthorization
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
- Create a ticketCreate a ticket
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { error, isProcessing } = this.state
const displayDropzone =
multiple || (!multiple && !this.props.uploadedFiles)
return (
- Create a ticketCreate a ticket