Showing 445 of 2,739 total issues
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
style,
className,
label,
Function extractExamples
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const extractExamples = file => {
const code = fs.readFileSync(file.path).toString();
const componentName = file.path.match(/src\/components\/([a-zA-Z]+)\/readme.md$/i)[1];
const examples = [];
const myPlugin = () => {
Function disableBodyScroll
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function disableBodyScroll(targetElement, options) {
if (isIosDevice) {
// targetElement must be provided, and disableBodyScroll must not have been
// called on this targetElement before.
if (!targetElement) {
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { label, className, variant, name, numbersMap, tooltip } = this.props;
const { stepState, isTooltipVisible } = this.state;
const shouldRenderNumber =
Function withReduxForm
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function withReduxForm(WrappedComponent) {
return class extends Component {
constructor(props) {
super(props);
this.fieldRef = React.createRef();
Function SignInExample
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function SignInExample() {
return (
<div className="rainbow-align-content_center rainbow-flex_column rainbow-sign-in_view-port">
<img
className="rainbow-m-bottom_x-large rainbow-sign-in_logo"
Function DirectionalFooter
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function DirectionalFooter(props) {
const {
onBack,
onNext,
currentStep,
Function File
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function File(props) {
const { className, style } = props;
return (
<svg
className={className}
Function Drawer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function Drawer(props) {
const {
id,
isOpen,
hideCloseButton,
- 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 useKeyboardNavigation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function useKeyboardNavigation(
country,
list,
ref,
scrollableRef,
- 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 PhoneInput
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const PhoneInput = React.forwardRef((props, ref) => {
const {
value,
name,
placeholder,
- 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 manageTab
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function manageTab(node, event) {
const tabbable = findTabbableElements(node);
if (!tabbable.length) {
event.preventDefault();
- 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 handleChangeHour
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
handleChangeHour(event) {
const { hour } = this.state;
const { hour24 } = this.props;
const { value } = event.target;
let normalizedValue;
- 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 getColumns
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function getColumns(params) {
const {
children = [],
showCheckboxColumn,
showRowNumberColumn,
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { label, description, style, assistiveText, children, className } = this.props;
const { isExpanded } = this.state;
const sectionMaxHeight = {
maxHeight: getMaxHeight(children, isExpanded),
Function Twitter
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Twitter = props => {
const { className, style } = props;
return (
<svg
className={className}
Function ButtonMenu
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ButtonMenu(props) {
const {
label,
icon,
iconPosition,
Function Label
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Label(props) {
const {
className,
label,
required,
Function handleSelectRow
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSelectRow(event, isMultiple, rowKeyValue) {
const { onRowSelection } = this.props;
const { indexes } = this;
const { rows } = this.state;
const maxRowSelection = this.getMaxRowSelection();
Function getRowsWithInitalSelectedRows
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getRowsWithInitalSelectedRows(params = {}) {
const { rows = [], selectedRows, maxRowSelection, indexes, selectedRowsKeys = {} } = params;
if (Array.isArray(selectedRows) && maxRowSelection > 0) {
const previousSelectionLength = getCurrentSelectionLength(selectedRowsKeys);