Showing 63 of 333 total issues
Function ExampleCrossSell
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ExampleCrossSell() {
const replyMock = {
title: 'Provide amazing customer service on social media',
subtitle:
'Respond to social conversations, resolve customer support requests, and create an outstanding experience.',
Function ExampleSelectWithCustomItem
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ExampleSelectWithCustomItem() {
return (
<Select
// @ts-expect-error TS(7006) FIXME: Parameter 'selectedItem' implicitly has an 'any' t... Remove this comment to see the full error message
onSelectClick={(selectedItem) => selectedItem.selectedItemClick()}
Function getTooltipPosition
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
getTooltipPosition(triggerRect, tooltipRect, position, verticalAlign) {
// @ts-expect-error TS(2339) FIXME: Property 'childWidth' does not exist on type 'Read... Remove this comment to see the full error message
const { childWidth } = this.state
const gap = 8
const triggerCenter = triggerRect.left + childWidth / 2
Function optimizeSvgs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function optimizeSvgs(icons) {
// https://github.com/svg/svgo/blob/master/examples/test.js
const svgo = new SVGO({
// Remove fills so all shapes inherit the CSS color
plugins: [{ removeAttrs: { attrs: '(stroke|fill)' } }],
Function renderContent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderContent = (channel) => {
const content = {}
switch (channel) {
case 'instagram':
// @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
Function getExampleData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getExampleData(examplesPath, componentName) {
// Get all the folders in src/docs/examples
const folders = getExampleFolders(examplesPath, componentName)
const fileExamples = getDocumentFiles(examplesPath, componentName)
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (proxy, allowedHost) {
return {
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
// websites from potentially accessing local content through DNS rebinding:
// https://github.com/webpack/webpack-dev-server/issues/887
Function ExampleSimpleModal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ExampleSimpleModal() {
const [modalOpen, openModal] = useState(false)
useEffect(() => {
const selfDestroy = setTimeout(() => {
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
// @ts-expect-error TS(2339) FIXME: Property 'item' does not exist on type 'Readonly<{... Remove this comment to see the full error message
item: { type, title, onItemClick, icon, selected, disabled, colors, tag },
// @ts-expect-error TS(2339) FIXME: Property 'ariaHaspopup' does not exist on type 'Re... Remove this comment to see the full error message
Function Option
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Option = (props) => {
const {
selected,
disabled,
icon,
- 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 updateIfNeeded
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
updateIfNeeded(prevProps) {
// @ts-expect-error TS(2339) FIXME: Property 'isOpen' does not exist on type 'Readonly... Remove this comment to see the full error message
const { isOpen, usingMouse, onOpen } = this.props
let newTabIndex = '-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 main
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function main() {
let spinner
try {
spinner = ora(`Loading BDS Icons Figma file: ${figmaIconFileUrl}`).start()
const figmaFile = await getFigmaFile(figmaIconFileId)
- 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 getDocumentsData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDocumentsData(documentsPath) {
const folders = getDocumentationFolders(documentsPath)
return folders.map((folder) => {
const documents = getDocumentFiles(documentsPath, folder)
Function ExampleSelectWithInputSearch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ExampleSelectWithInputSearch() {
return (
<Select
onSelectClick={() => true}
// @ts-expect-error TS(7006) FIXME: Parameter 'onButtonClick' implicitly has an 'any' ... Remove this comment to see the full error message
Function getStyleLoaders
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getStyleLoaders = (cssOptions, preProcessor) => {
const loaders = [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
// @ts-expect-error TS(2339) FIXME: Property 'match' does not exist on type 'Readonly<... Remove this comment to see the full error message
match: {
params: { route, location, view },
- 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 onKeyDown
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onKeyDown(event) {
// eslint-disable-line
const {
// @ts-expect-error TS(2339) FIXME: Property 'history' does not exist on type 'Readonl... Remove this comment to see the full error message
history,
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
const Button = ({
// @ts-expect-error TS(7031) FIXME: Binding element 'disabled' implicitly has an 'any'... Remove this comment to see the full error message
disabled,
// @ts-expect-error TS(7031) FIXME: Binding element 'onClick' implicitly has an 'any' ... Remove this comment to see the full error message
onClick,
- 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 SimpleModal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SimpleModal = ({ children, closeAction }) => {
const modalRef = useRef(null)
const containerRef = useRef(null)
const {
AnimationWrapper,
- 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 ExampleSelectWithSelectAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ExampleSelectWithSelectAll() {
const [items, setItems] = useState(data)
// @ts-expect-error TS(7006) FIXME: Parameter 'option' implicitly has an 'any' type.
const handleClick = (option) => {
- 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"