Showing 24 of 37 total issues
Function feed
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function feed(state={}, action) {
let elementHeight;
switch(action.type){
case types.INITIALIZING :
state.isInitialized = false;
- 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 feed
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function feed(state={}, action) {
let elementHeight;
switch(action.type){
case types.INITIALIZING :
state.isInitialized = false;
Function menu
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function menu(state={}, action) {
switch(action.type){
case types.INITIALIZE_KEYWORD :
state.keywords = action.keywords;
state.activeKeyword = 'all';
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (!this.props.feed.isInitialized) return <div className="rect-spinner"></div>;
const feed = this.props.feed[this.props.menu.activeKeyword];
return (
<div id="container">
Function exports
has 28 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {item, activeKeyword, id, bookmarkFilter} = this.props;
const favicon = FAVICON_URI + encodeURIComponent(item.link);
const hatebuHref = ENTRY_URI + encodeURIComponent(item.link);
const hatebuImage = BOOKMARK_IMAGE_URI + item.link;
Function _fetchUserFeed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _fetchUserFeed(dispatch, keyword, user, page = 0, threshold) {
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);
Avoid too many return
statements within this function. Open
Open
return Object.assign({}, state);