Showing 137 of 273 total issues
File index.tsx
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useMemo } from 'react';
import Prism from 'prismjs';
import {
useDelta,
EddyReducer,
Function indent
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
function indent(
{ code, cursor, inverse }: EditorIndentValue,
{ tabs, width }: Indentation,
): EditorValue {
if (!cursor) {
- 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 indent
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
function indent(
{ code, cursor, inverse }: EditorIndentValue,
{ tabs, width }: Indentation,
): EditorValue {
if (!cursor) {
- 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 persist
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function persist( Model $model ) {
$result = $model->get_primary_id() ?
wp_update_post( $model->get_underlying_wp_object(), true ) :
wp_insert_post( (array) $model->get_underlying_wp_object(), 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 editorReducer
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const editorReducer: EddyReducer<EditorState, RootAction> = (
state = defaultState,
action: RootAction,
) => {
switch (action.type) {
File editor.ts
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getType } from 'typesafe-actions';
import { EddyReducer } from 'brookjs';
import {
editorThemeChange,
editorTabsToggle,
Method add_routes
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add_routes( CoreRouter $router ) {
$router->set_vendor( 'intraxia' )->set_version( 1 );
$router->group( array( 'prefix' => '/gistpen' ), function ( CoreRouter $router ) {
$search = $this->container->get( \Intraxia\Gistpen\Http\SearchController::class );
Function embedReducer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
const embedReducer: EddyReducer<EmbedState, RootAction> = (
state = defaultEmbedState,
action: RootAction,
) => {
switch (action.type) {
Function merge
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function merge( array $attributes ) {
try {
$blobs = $this->blobs;
} catch ( \Exception $exception ) {
$blobs = new Collection( Blob::class );
- 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
AbstractJob
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractJob implements Job {
/**
* EntityManager service.
*
* @var EntityManager
Function refresh
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function refresh( array $attributes ) {
try {
$prev_blobs = $this->blobs;
} catch ( \Exception $exception ) {
$prev_blobs = new Collection( Blob::class );
- 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 reducer
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, RootAction> = (
state: State,
action: RootAction,
): State | Result<State, RootAction> => {
switch (state.status) {
Method persist
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function persist( Model $model ) {
$result = $model->get_primary_id() ?
wp_update_post( $model->get_underlying_wp_object(), true ) :
wp_insert_post( (array) $model->get_underlying_wp_object(), true );
Function rootDelta
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const rootDelta: Delta<RootAction, State> = (action$, state$) => {
const fetch$ = state$
.thru(sampleByAction(action$, fetchBlob.request))
.flatMap(state =>
ajax$(
Function create
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function create( $class, array $data = array(), array $options = array() ) {
$model = new $class();
/**
* Set aside the `blobs` key for use.
- 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 reducer
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const reducer: EddyReducer<State, RootAction> = (
state: State = initialState,
action: RootAction,
) => {
switch (action.type) {
Function patch
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function patch( array $patch ) {
foreach ( $patch as $key => $value ) {
if ( ! array_key_exists( $key, static::$defaults ) ) {
throw new InvalidArgumentException( $key );
}
- 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
File WordPressPost.php
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Intraxia\Gistpen\Database\Repository;
use Exception;
Function findOffset
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export function findOffset(root: Element, ss: number): Offset {
// @TODO(mAAhaTTah) these types seem sketchy...
let container;
let offset = 0;
let element: ChildNode | null = root;
- 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 findOffset
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default function findOffset(root: Element, ss: number): Offset {
let container;
let offset = 0;
let element: ChildNode | null = root;
- 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"