dodekeract/impequid

View on GitHub

Showing 55 of 55 total issues

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

            leftEntries.push(
                <li key={leftKey++} className={"nav-item" + activeRoute('/')}>
                    <a className="nav-link" href="/">About</a>
                </li>
            );
Severity: Major
Found in source/client/components/header.jsx and 3 other locations - About 1 hr to fix
source/client/components/header.jsx on lines 19..23
source/client/components/header.jsx on lines 40..44
source/client/components/header.jsx on lines 45..49

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 69.

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 4 locations. Consider refactoring.
Open

            rightEntries.push(
                <li key={rightKey++} className={"nav-item" + activeRoute('/login')}>
                    <a className="nav-link" href="/login">Login</a>
                </li>
            );
Severity: Major
Found in source/client/components/header.jsx and 3 other locations - About 1 hr to fix
source/client/components/header.jsx on lines 19..23
source/client/components/header.jsx on lines 35..39
source/client/components/header.jsx on lines 40..44

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 69.

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 4 locations. Consider refactoring.
Open

            leftEntries.push(
                <li key={leftKey++} className={"nav-item" + activeRoute('/register')}>
                    <a className="nav-link" href="/register">Register</a>
                </li>
            );
Severity: Major
Found in source/client/components/header.jsx and 3 other locations - About 1 hr to fix
source/client/components/header.jsx on lines 19..23
source/client/components/header.jsx on lines 35..39
source/client/components/header.jsx on lines 45..49

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 69.

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 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function * render () {
    const path = this.url;

    // whitelist paths
    const matched = ['/', '/login', '/register'].indexOf(path) !== -1;
Severity: Minor
Found in source/server/routes/apps/main.js - About 1 hr to fix

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

        render () {
            return (
                <main>
                    <section className="jumbotron text-xs-center custom-noradius">
                        <div className="container">
    Severity: Minor
    Found in source/client/components/about.jsx - About 1 hr to fix

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

          render () {
              const {actions, state} = this.props;
              return (
                  <main className="jumbotron custom-noradius">
                      <div className="register">
      Severity: Minor
      Found in source/client/components/register.jsx - About 1 hr to fix

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

                const user = yield new Promise((resolve, reject) => {
                    async.series([callback => {
                        console.log('verifying captcha');
                        // verify captcha
                        reCaptchaValidator.promise(config.reCaptcha.secret, captcha, ip).then(() => {
        Severity: Minor
        Found in source/server/routes/api/main/login.js - About 1 hr to fix

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

                                      <small className="text-muted">Passwords are never stored <a target="_blank" href="https://en.wikipedia.org/wiki/Cryptographic_hash_function">unhashed</a> or <a target="_blank" href="https://en.wikipedia.org/wiki/Salt_(cryptography)">unsalted</a>.</small>
          Severity: Major
          Found in source/client/components/register.jsx and 1 other location - About 1 hr to fix
          source/client/components/about.jsx on lines 16..19

          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 63.

          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

                                  <p className="btn-group">
                                      <a href="/login" className="btn btn-primary">Login</a>
                                      <a href="/register" className="btn btn-secondary">Register</a>
                                  </p>
          Severity: Major
          Found in source/client/components/about.jsx and 1 other location - About 1 hr to fix
          source/client/components/register.jsx on lines 28..28

          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 63.

          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 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render () {
                  let key = 0;
          
                  const main = this.state.login.valid ? (
                      <main className="jumbotron custom-noradius">
          Severity: Minor
          Found in source/client/components/authenticate.jsx - About 1 hr to fix

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

                                        <input id="registerName" value={state.name} onChange={actions.updateName} type="text" name="username" className="form-control" placeholder="Username" required autofocus/>
            Severity: Major
            Found in source/client/components/register.jsx and 1 other location - About 1 hr to fix
            source/client/components/login.jsx on lines 30..30

            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 60.

            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

                                        <input id="registerName" value={state.name} onChange={actions.updateName} type="text" name="name" className="form-control" placeholder="Username" required autofocus/>
            Severity: Major
            Found in source/client/components/login.jsx and 1 other location - About 1 hr to fix
            source/client/components/register.jsx on lines 15..15

            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 60.

            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 deserializePermissionTree has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function deserializePermissionTree (serializedTree) {
            
                // resulting tree
            
                const result = {};
            Severity: Minor
            Found in source/server/utilities.js - About 1 hr to fix

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

                                          <input id="registerPassword" value={state.password} onChange={actions.updatePassword} type="password" name="password" className="form-control" placeholder="Password" required/>
              Severity: Major
              Found in source/client/components/register.jsx and 2 other locations - About 1 hr to fix
              source/client/components/login.jsx on lines 34..34
              source/client/components/register.jsx on lines 20..20

              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 57.

              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 3 locations. Consider refactoring.
              Open

                                          <input id="registerPassword" value={state.password} onChange={actions.updatePassword} type="password" name="password" className="form-control" placeholder="Password" required/>
              Severity: Major
              Found in source/client/components/login.jsx and 2 other locations - About 1 hr to fix
              source/client/components/register.jsx on lines 20..20
              source/client/components/register.jsx on lines 25..25

              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 57.

              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 3 locations. Consider refactoring.
              Open

                                          <input id="registerEmail" value={state.email} onChange={actions.updateEmail} type="email" name="email" className="form-control" placeholder="Email Address" required/>
              Severity: Major
              Found in source/client/components/register.jsx and 2 other locations - About 1 hr to fix
              source/client/components/login.jsx on lines 34..34
              source/client/components/register.jsx on lines 25..25

              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 57.

              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 deserializePermissionTree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              export function deserializePermissionTree (serializedTree) {
              
                  // resulting tree
              
                  const result = {};
              Severity: Minor
              Found in source/server/utilities.js - About 1 hr 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 token has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function * token (next) {
                  const {token} = this.headers;
              
                  try {
                      const type = token.charAt(0);
              Severity: Minor
              Found in source/server/routes/api/external.js - About 1 hr to fix

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

                    register () {
                        this.isLoggedIn(false);
                        return (
                            <Register actions={actions.login} state={this.state.login}/>
                        )
                Severity: Minor
                Found in source/client/components/main.jsx and 1 other location - About 55 mins to fix
                source/client/components/main.jsx on lines 53..58

                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 54.

                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

                    login () {
                        this.isLoggedIn(false);
                        return (
                            <Login actions={actions.login} state={this.state.login}/>
                        );
                Severity: Minor
                Found in source/client/components/main.jsx and 1 other location - About 55 mins to fix
                source/client/components/main.jsx on lines 60..65

                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 54.

                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