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' : '';
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;
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">
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">
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(() => {
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">
Function deserializePermissionTree
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function deserializePermissionTree (serializedTree) {
// resulting tree
const result = {};
Function deserializePermissionTree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function deserializePermissionTree (serializedTree) {
// resulting tree
const result = {};
- Read upRead up
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);
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;
- Read upRead up
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
- Read upRead up
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"