Showing 77 of 176 total issues
Function reducer
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case VERSES_CLEAR_CURRENT: {
const stateFilesCurrent = state.files;
Function filterValidVerse
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function filterValidVerse(replaceState, chapterId, verseRange) {
const chapterToVersesMap = {
1: 7,
2: 286,
3: 200,
Function render
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { open, handleOpen, children } = this.props;
return (
<div className={`${styles.container} sidebar ${open && styles.open}`}>
Function exports
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
chapter,
chapters,
setOption,
Function renderRangeAyahs
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderRangeAyahs() {
const { chapter, repeat, setRepeat } = this.props;
const array = Array(chapter.versesCount).join().split(',');
return (
Function reducer
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case SET_CURRENT_VERSE: {
return {
...state,
File index.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component, PropTypes } from 'react';
import * as customPropTypes from 'customPropTypes';
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
import Popover from 'react-bootstrap/lib/Popover';
import Nav from 'react-bootstrap/lib/Nav';
Function renderPopup
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderPopup() {
return (
<div>
<ul className={style.list}>
<li className={`text-center ${style.item}`}>
Function reducer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case SET_OPTION: {
const payload = action.payload;
return {
Function renderStatsBar
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderStatsBar() {
const { totalCount, totalPages, currentPage, query, perPage } = this.props;
const from = Math.max(...[(currentPage - 1) * perPage, 1]);
const to = Math.min(...[currentPage * perPage, totalCount]);
const values = { from, to, query, total: totalCount };
Function reducer
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case SURAHS_SET_CURRENT:
return {
...state,
Function renderRightControls
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderRightControls() {
const { user, rightControls } = this.props;
return (
rightControls || [
Function reducer
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case SAVE: {
cookie.save('auth', {
client: action.data.client_id,
Function reducer
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case VERSES_CLEAR_CURRENT: {
const stateFilesCurrent = state.files;
- 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 render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { repeat } = this.props;
const popover = (
<Popover
Function renderForm
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderForm() {
return (
<form className="form-horizontal" onSubmit={this.submitSupport}>
<div className="form-group">
<label htmlFor="name" className="col-sm-2 control-label">Name</label>
Function checkValidChapterOrVerse
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function checkValidChapterOrVerse(nextState, replaceState) {
const chapterId = parseInt(nextState.params.chapterId, 10);
filterValidChapter(replaceState, chapterId);
if (nextState.params.range) {
- 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 render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { leftControls, handleSidebarToggle, isStatic } = this.props;
debug('component:GlobalNav', 'Render');
return (
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// Don't show banner when:
// 1) if device isn't iOS or Android
// 2) website is loaded in app,
// 3) user dismissed banner,