dodekeract/impequid

View on GitHub

Showing 11 of 55 total issues

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

    render () {
        const {state, actions, active} = this.props;

        const activeRoute = (route) => {
            return route === active ? ' active' : '';
Severity: Major
Found in source/client/components/header.jsx - About 2 hrs to fix

    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

            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

              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

                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

                  Function render has a Cognitive Complexity of 9 (exceeds 5 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 55 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

                  Function checkPermission has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function checkPermission (desired) {
                  
                      let pointer = this.permissions[this.token.type];
                  
                      // check if permission wildcard was used
                  Severity: Minor
                  Found in source/server/utilities.js - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language