Showing 173 of 964 total issues
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div>
<Card>
<CardText>
Function renderFieldsFromFieldConfigs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderFieldsFromFieldConfigs() {
return this.props.fieldConfigs
.filter(fieldConfig => fieldConfig.type)
.map((fieldConfig) => {
const fieldValue = this.props.source && this.props.source[fieldConfig.name];
Function setSearchValue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setSearchValue(searchValue) {
const matchesSearchValue = filterByValue(searchValue.trim().toLowerCase().split(/\s+/));
searchSourceStore$
.take(1)
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { enabled, fileType, fileModel } = this.props;
return (
<Fragment>
Function generatePeriods
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.generatePeriods = config => {
let periods = [];
const offset = parseInt(config.offset, 10);
const isFilter = config.filterFuturePeriods;
const isReverse = config.reversePeriods;
Function PeriodType
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function PeriodType() {
const monthNames = [
'January',
'February',
'March',
- 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 insertHelper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const insertHelper = (TYPE, WITH_SPACE, currentInput, cursorStart, emoticon = null) => {
switch (TYPE) {
case LINK:
return WITH_SPACE
? insertLinkWithSpace(currentInput, cursorStart)
- 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 haveWriteAccess
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const haveWriteAccess = (d2, userGroups, object) => {
const { currentUser } = d2 || {};
if (!object || !currentUser) {
return 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const filterHeight = this.getFilterText().length > 0 ? 15 : 0;
const styles = {
container: {
display: 'flex',
- 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 haveReadAccess
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const haveReadAccess = (d2, userGroups, object) => {
const { currentUser } = d2 || {};
if (!object || !currentUser) {
return 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 MonthlyPeriodType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function MonthlyPeriodType(formatYyyyMmDd, monthNames, fnFilter) {
const formatIso = date => {
const y = date.getFullYear();
let m = String(date.getMonth() + 1);
- 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 forEachOnPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const forEachOnPath = (root, path, op) => {
op(root);
if (
path.length > 0 &&
(Array.isArray(root.children) || root.children.size > 0)
- 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 renderHelpText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
renderHelpText() {
if ((!this.props.fieldOptions || !this.props.fieldOptions.helpText) || this.props.errorMessage) {
return null;
}
- 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 extract
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const extract = async ({ input, output }) => {
const relativeInput = "./" + path.relative(process.cwd(), input);
if (!checkDirectoryExists(input)) {
reporter.error(
`I18n source directory ${chalk.bold(relativeInput)} does not exist.`
- 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 Button
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Button = ({ raised, fab, color, disabled, onClick, children, style, selector }) => {
const className = createClassName('d2-ui-button', selector);
let MuiButton;
if (fab) { // Always raised
- 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 OrgUnitModelArrayElementValidator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function OrgUnitModelArrayElementValidator(propValue, key, componentName, location, propFullName) {
Function orgUnitPathPropValidator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
propValue,
key,
compName,
location,
propFullName
Function renderLabel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
renderLabel(
isSelected,
isSelectable,
isInitiallyExpanded,
canBecomeCurrentRoot,
- 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 concatHelper
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const concatHelper = (TYPE, WITH_SPACE, currentInput, highlightedText, cursorStart, cursorEnd) => {
switch (TYPE) {
case LINK:
return WITH_SPACE
? concatLinkWithSpace(currentInput, highlightedText, cursorStart, cursorEnd)
- 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 PublicAccessValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const PublicAccessValue = ({ value }) => {
const metaData = value.substr(0, 2);
const data = value.substr(2, 2);
const other = value.substr(4, 4);
- 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"