Showing 29 of 110 total issues
File KanbanApplication.jsx
has 476 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import isEqual from 'lodash/isEqual';
import assign from 'lodash/assign';
import clone from 'lodash/clone';
Function renderCustomHast
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
static renderCustomHast(customHast, ctx = {}) {
function h(name, properties, children) {
if (name.indexOf('app:') === 0) {
const appName = name.substring(4);
const appComponent = Apps[appName];
- 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 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { modalIsOpen, deletePageName, deleteErrorMsg } = this.state;
const modalStyles = {
wrapper: {
content: {
Function componentDidMount
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentDidMount() {
const { data } = this.props;
const map = MapModel.deserialize(data);
const doc = this.refIframe.current.contentWindow.document;
doc.open();
Function render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.props;
const { voted } = this.state;
const model = VoteHelpfulModel.deserialize(data);
const colors = { No: '#da3d3d', Yes: '#218bce' };
File AppEnabledWikiEditorCodeMirror.jsx
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import { diffChars } from 'diff';
import { UnControlled as CodeMirror } from 'react-codemirror2';
import 'codemirror/mode/markdown/markdown';
File Main.jsx
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { Link as RouterLink } from 'react-router-dom';
import TimeAgo from 'react-timeago';
import Modal from 'react-modal';
import { createHashHistory } from 'history';
Function renderAnswers
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderAnswers(model) {
const { editing } = this.state;
const header = (
<tr>
<th>Attendees / Date</th>
Function renderListPages
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderListPages() {
const { pages, currentPageNum, getPagesError } = this.state;
const metadataStyle = {
margin: '0 0 0 0.5em',
color: 'grey',
Function renderCustomHast
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static renderCustomHast(customHast, ctx = {}) {
function h(name, properties, children) {
if (name.indexOf('app:') === 0) {
const appName = name.substring(4);
const appComponent = Apps[appName];
Function handleAppEdit
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAppEdit(newText, appContext) {
const cm = this.refEditor.current.editor;
const startFencedStr = cm.getLine(appContext.position.start.line - 1);
const [backticks] = WikiParser.getExtraFencingChars(startFencedStr, newText);
if (backticks) {
Function h
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function h(name, properties, children) {
if (name.indexOf('app:') === 0) {
const appName = name.substring(4);
const appComponent = Apps[appName];
const position = JSON.parse(properties.position);
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { doc, match } = this.props;
const pageName = match.params.page;
const roomName = doc ? null : pageName;
const defaultValue = doc ? `loading ${pageName}...` : `syncing with ${pageName}...`;
Function configure
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function configure(baseConfig, mode) {
const { config } = baseConfig;
config.devtool = mode === 'PRODUCTION' ? 'source-map' : 'eval-source-map';
config.resolve.extensions.push('.jsx');
config.plugins.push(new CopyWebpackPlugin({
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.props;
const draw = DrawModel.deserialize(data);
const { electedTemp, start } = this.state;
let dispElected = electedTemp || draw.elected;
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.props;
const model = ReversiModel.deserialize(data);
const cells = model.getCells();
const counts = model.getStoneCounts();
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { data } = this.props;
const model = VoteCryptoModel.deserialize(data);
const { voteMessage, errorMessage } = this.state;
let votingResult = '';
Function getListPages
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
async getListPages() {
try {
const response = await window.fetch(`${url}/pages`, {
headers,
});
- 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 attendees
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const attendees = Object.keys(model.attendees).map((attendeeName) => {
const ans = model.attendees[attendeeName] || {};
const isEditingRow = attendeeName === editing;
return (
<tr key={attendeeName}>
Function deserialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static deserialize(str) {
try {
const reList = /^[*-]\s*(.*)$/;
const reItem = /^\s+[*-]\s*(.*)$/;
const reText = /^([*_]*)(.*?)([*_]*)$/;