Showing 85 of 714 total issues
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
children,
theme,
arrowPlacement,
Function createPackageFile
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createPackageFile() {
return new Promise(resolve => {
fse.readFile(path.resolve(__dirname, '../../package.json'), 'utf8', (err, data) => {
if (err) {
throw err;
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { height, paddingTop, paddingBottom, initialOpen } = this.state;
const {
children,
collapsed,
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const ComponentClass = this.props.componentClass;
const classes = classNames(
{
Function renderTrigger
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderTrigger() {
const {
trigger,
visible,
onVisibleChange,
Function withNoScroll
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function withNoScroll(Portal) {
let portalVisibleCount = 0;
let originalOverflow;
return class NonScrollableWrapper extends Component {
- 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 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { title, onDelete, className, id, ...restProps } = this.props;
const rest = omit(restProps, ['isOpen', 'onToggle']);
const { isOpen } = this.state;
const wrapperClassName = mergeClassNames({
Function buildDocs
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildDocs(componentPath) {
// eslint-disable-next-line global-require, import/no-dynamic-require
const component = require(componentPath);
const styles = {
Function withCloseOnEsc
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function withCloseOnEsc(Closable) {
return class ESCToCloseWrapper extends Component {
static propTypes = {
visible: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
className,
wrapperClassName,
trigger,
Function generatePropDescription
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generatePropDescription(required, description, type) {
let deprecated = '';
if (type.name === 'custom') {
const deprecatedInfo = getDeprecatedInfo(type);
Function formateData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
formateData(data, props) {
data = data || this.sourceData;
props = props || this.props;
const that = this;
const { selectedItem, selectedItems } = this.state;
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
iconClassName,
className,
children,
Function show
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show() {
if (this.props.disabled) {
return;
}
if (this._unmounted) {
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { trigger, content } = this.validateChildren();
const {
display,
prefix,
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
id,
style,
className,
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const child = this.props.children;
if (child) {
return cloneElement(child, {
ref: ref => (this._childNode = ReactDOM.findDOMNode(ref)),
- 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 locate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function locate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function locate(anchorBoundingBox, containerBoundingBox, contentDimension, options) {
const viewport = getViewportSize();
const { anchorBoundingBoxViewport, cushion } = options;
let horizontal;
Function renderContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderContent() {
const {
prefix,
content,
header,