Showing 31 of 129 total issues
Function connect
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const connect = configuration => {
const wsUrl = guessWSURL(configuration)
let reconnectionAttempts =
'reconnectionAttempts' in configuration
? configuration.reconnectionAttempts
Function subscribe
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public subscribe(clientId: string, subscription: Subscription) {
if (!this.clients[clientId]) {
this.logger.error(`Unable to find a client with id '${clientId}'`)
return
}
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
dashboard: { columns, rows, widgets: _widgets },
dashboardIndex,
registry,
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { apiData } = this.props
const items = []
Function createBlogPages
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createBlogPages = (graphql, createPage, createRedirect) => {
const query = `{
posts: allMarkdownRemark(
filter: {
fileAbsolutePath: { regex: "//posts/" }
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { themes, currentTheme, setTheme, opened, close } = this.props
const settings = []
if (opened) {
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isLoading,
dashboards,
currentDashboard,
Function start
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public start(existingApp?: Express) {
if (!this.configuration) {
this.logger.error(
chalk.red(
`no configuration, you must either call 'configure()' or 'configureFromFile()' before starting Mozaïk server`
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
dashboards,
currentDashboardIndex,
isPlaying,
Function DocumentationPage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DocumentationPage = props => {
const {
data: {
markdownRemark: {
frontmatter,
Function PostPage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PostPage = props => {
const {
data: {
markdownRemark: {
frontmatter,
Function notify
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
export const notify = notification => {
return (dispatch, getState) => {
const {
notifications: { items },
} = getState()
- 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 subscribe
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public subscribe(clientId: string, subscription: Subscription) {
if (!this.clients[clientId]) {
this.logger.error(`Unable to find a client with id '${clientId}'`)
return
}
- 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 configuration
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function configuration(state = defaultState, action) {
switch (action.type) {
case API_SUBSCRIBE:
if (state.get('subscriptions').has(action.subscription.id)) {
return state
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
dashboards,
currentDashboardIndex,
isPlaying,
Function createDocumentationPages
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const createDocumentationPages = (graphql, createPage) => {
const query = `{
allMarkdownRemark(filter: {
fileAbsolutePath: {
regex: "//docs/"
Function setDashboards
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const setDashboards = dashboards => {
return (dispatch, getState) => {
const { api } = getState()
const currentSubscriptionsIds = api
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { currentDashboardIndex, title } = this.props
const items = [{ key: currentDashboardIndex, title }]
Function fetchConfiguration
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const fetchConfiguration = () => {
return dispatch => {
dispatch({ type: FETCH_CONFIGURATION })
return fetch('/config')
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { title, subject, subjectPlacement, count, icon: _icon, style, theme } = this.props
let subjectNode = null
if (subject) {