Showing 173 of 964 total issues
Function componentDidMount
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentDidMount() {
this.context.d2.models.program.list(
{
paging: false,
fields: 'id,displayName,programTrackedEntityAttributes[id,displayName,trackedEntityAttribute],programIndicators[id,displayName,dimensionItem]',
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let icon;
switch (this.props.type) {
case SUCCESS:
icon = (
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div style={styles.container}>
<div style={styles.title}>
{this.context.d2.i18n.getTranslation(
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<div>
<Card style={Object.assign({}, this.styles.card, { width: 250 })}>
<CardText style={this.styles.cardText}>
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<TreeView label="Persistent Root" persistent>
<TreeView label="Branch 1" initiallyExpanded>
<TreeView label="Sub-branch 1" initiallyExpanded>
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
profileItems,
notifications,
noLoadingIndicator } = this.props;
Function renderSubscriptionButton
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSubscriptionButton() {
const tOpts = { object: translateModelName(this.props.model.modelName) };
const [SubscriberIcon, subscriptionTooltip] = this.props.model.subscribed
? [
SubscriberIconEnabled,
Function fetchData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
export const fetchData = () => {
return (dispatch, getState) => {
const state = getState();
dispatch(toggleLoading());
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const itemsPerRow = this.props.rowItemCount;
const menuWidth = itemsPerRow * MENU_ITEM_WIDTH;
const { name, children } = this.props;
const menuStyle = Object.assign({}, styles.dropDownWrap, {
Function componentWillMount
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentWillMount() {
if (!this.props.expressionStatusStore) {
return true;
}
Function BiWeeklyPeriodType
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function BiWeeklyPeriodType(formatYyyyMmDd, fnFilter) {
this.generatePeriods = config => {
let periods = [];
const offset = parseInt(config.offset, 10);
const isFilter = config.filterFuturePeriods;
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { open } = this.props;
return (
<Dialog open={open} onClose={this.onRequestClose} maxWidth="md">
Function TwoPanelSelector
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TwoPanelSelector(props) {
const { children, childWrapStyle, mainStyle, sizeRatio, ...otherProps } = props;
const mergedMainStyle = {
flex: 1,
display: 'flex',
Function UserOrgUnitsPanel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserOrgUnitsPanel = props => {
return (
<div style={styles.container}>
<Grid
container
Function generatePeriods
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.generatePeriods = config => {
let periods = [];
const offset = parseInt(config.offset, 10);
const isFilter = config.filterFuturePeriods;
const isReverse = config.reversePeriods;
Function renderActionButtons
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderActionButtons() {
return (
<DialogActions>
<Button
color="primary"
Function withPropsFromObservable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function withPropsFromObservable(observable, BaseComponent) {
class WithPropsFromComponent extends Component {
constructor(props, context) {
super(props, context);
Function getContent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getContent() {
const {
classes,
currentInterpretationId,
onCurrentInterpretationChange,
Function parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
const parse = (code) => (state, silent) => {
if (silent) return false;
const start = state.pos;
- 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 renderLevel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderLevel(level, isLastChild) {
const styles = {
leafNode: {},
leafLabel: {
fontSize: 11,