saarnilauri/fida-imu

View on GitHub

Showing 75 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    <Card
      className="text-white bg-primary py-5 d-md-down-none"
      style={{ width: `${44}%` }}
    >
      <CardBody className="text-center">
Severity: Major
Found in src/components/User/SignUp/index.js and 1 other location - About 4 hrs to fix
src/components/User/PasswordForget/index.js on lines 27..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    <Card
      className="text-white bg-primary py-5 d-md-down-none"
      style={{ width: `${44}%` }}
    >
      <CardBody className="text-center">
Severity: Major
Found in src/components/User/PasswordForget/index.js and 1 other location - About 4 hrs to fix
src/components/User/SignUp/index.js on lines 29..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  class WithCountries extends Component {
    componentDidMount() {
      if (!this.props.ready) {
        this.props.loadCountries()
      }
Severity: Major
Found in src/components/hoc/withCountries.js and 1 other location - About 3 hrs to fix
src/components/hoc/withEntities.js on lines 34..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  class WithEntities extends Component {
    componentDidMount() {
      if (!this.props.ready) {
        this.props.loadEntities()
      }
Severity: Major
Found in src/components/hoc/withEntities.js and 1 other location - About 3 hrs to fix
src/components/hoc/withCountries.js on lines 28..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

              <div className="py-2">
                <Label for="1234">
                  <Fontawesome name="home" />{' '}
                  {formatMessage({ id: 'account.page.churches' })}
                </Label>
Severity: Major
Found in src/components/UserProfileForm/index.js and 1 other location - About 2 hrs to fix
src/components/UserProfileForm/index.js on lines 177..186

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

              <div className="py-2">
                <Label for="123">
                  <Fontawesome name="globe" />{' '}
                  {formatMessage({ id: 'account.page.coutries' })}
                </Label>
Severity: Major
Found in src/components/UserProfileForm/index.js and 1 other location - About 2 hrs to fix
src/components/UserProfileForm/index.js on lines 187..196

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 91.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const mapStateToProps = state => ({
  authUser: state.sessionState.authUser,
  data:
    state.countryState.collectionReady === true
      ? collectionToArray(state.countryState.countriesCollection)
Severity: Major
Found in src/components/Country/List/index.js and 1 other location - About 1 hr to fix
src/components/Country/List/Page.js on lines 161..168

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const mapStateToProps = state => ({
  authUser: state.sessionState.authUser,
  data:
    state.countryState.collectionReady === true
      ? collectionToArray(state.countryState.countriesCollection)
Severity: Major
Found in src/components/Country/List/Page.js and 1 other location - About 1 hr to fix
src/components/Country/List/index.js on lines 132..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    auth
      .doPasswordReset(email)
      .then(() => {
        this.setState(() => ({ ...INITIAL_STATE }))
      })
Severity: Major
Found in src/components/User/PasswordForget/index.js and 1 other location - About 1 hr to fix
src/components/PasswordChange/index.js on lines 25..32

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    auth
      .doPasswordUpdate(passwordOne)
      .then(() => {
        this.setState(() => ({ ...INITIAL_STATE }))
      })
Severity: Major
Found in src/components/PasswordChange/index.js and 1 other location - About 1 hr to fix
src/components/User/PasswordForget/index.js on lines 65..72

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <CardHeader className="bg-light text-left text-dark">
              <span>
                {this.props.midTitle}{' '}
                <HelpButton id={midHeaderId} onClickEvent={this.helpClick} />
              </span>
Severity: Major
Found in src/components/ResultsChain/Column/index.js and 1 other location - About 1 hr to fix
src/components/ResultsChain/Column/index.js on lines 89..94

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <CardHeader className="bg-secondary text-white text-left">
              <span>
                {this.props.botTitle}{' '}
                <HelpButton id={botHeaderId} onClickEvent={this.helpClick} />
              </span>
Severity: Major
Found in src/components/ResultsChain/Column/index.js and 1 other location - About 1 hr to fix
src/components/ResultsChain/Column/index.js on lines 75..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 71.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language