Showing 34 of 100 total issues
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div
className={cx({
notification: true,
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="logo">
<div className="logo-image" onClick={this.toggleMenu}>
<div
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const cardStyle = {
backgroundImage: `url(${this.props.series.anime.poster_image})`
};
return (
Function showSeries
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function showSeries(id, type = 'anime', seriesData) {
if (seriesData) {
return (dispatch) => {
dispatch({
type: SHOW_SERIES_SUCCESS,
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="carousel" onWheel={this.handleWheel} onMouseEnter={this.setMaxPositionX} ref="carousel">
<div className="carousel-top">
<div className="carousel-header">
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="chart">
<ChartMenu {...this.props} />
<div className="chart-items">
Function loadRSS
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function loadRSS() {
return (dispatch, getState) => {
dispatch({
type: SHOW_RSS_REQUEST
});
Function loadCalendar
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function loadCalendar() {
return (dispatch) => {
dispatch({
type: LOAD_CALENDAR_REQUEST,
});
Function loadEpisodes
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function loadEpisodes() {
return (dispatch, getState) => {
const { seriesVisible, currentSeries } = getState();
if (seriesVisible && currentSeries.type === 'tv') {
dispatch({
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div className="search-result">
<div className="search-result-left">
<div className="search-result-meta">
Function addListItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addListItem(series) {
if (!this.authenticated) return Promise.reject('not authenticated');
if (!_.get(series, 'item')) return Promise.reject('no item prop found');
const listType = utils.isAnime(series.type) ? 'anime' : 'manga';
const { item } = series;
Function updateListItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateListItem(series) {
if (!this.authenticated) return Promise.reject('not authenticated');
const { item } = series;
return new Promise((resolve, reject) => {
request
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
return (
<div
className={cx({
series: true,
- 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 listSortOrder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export function listSortOrder(state = initialState.listSortOrder, action = {}) {
switch (action.type) {
case SORT_LIST:
if (action.prevListSortBy === action.listSortBy) {
return state === 'asc' ? 'desc' : 'asc';
- 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"