Showing 7 of 68 total issues
Function AutocompleteSearch
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AutocompleteSearch = observer((props: Props) => {
const { autoFocus, open } = props
const searchInputRef = useSearchInputRef()
const options = useOptions()
const { userStore, searchStore } = useStore()
File FocusStore.tsx
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { makeAutoObservable } from 'mobx'
import Store from 'stores'
import log from 'libs/log'
import Tab from './Tab'
import Window from './Window'
Function Icon
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Icon = observer((props: TabProps) => {
const { userStore } = useStore()
const { focus, select, iconUrl, isSelected, bulkSelect } = props.tab
const checkbox = (
<Checkbox
Function constructor
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(tab, store: Store, win: Window) {
super(store)
makeObservable(this, {
cookieStoreId: observable,
Function TabContent
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props: TabProps & { buttonClassName: string; content: ReactElement }) => {
const { faked, buttonClassName, content } = props
const { hoverStore, dragStore } = useStore()
const { activate, title, url, isDuplicated, focus, isFocused, isHovered } =
props.tab
Function transform
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transform: function (content) {
const json = JSON.parse(content.toString())
if (process.env.NODE_ENV === 'production') {
delete json.content_security_policy
}
Function tabComparator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export const tabComparator = (a, b) => {
if (a.pinned ^ b.pinned) {
return b.pinned ? 1 : -1
}
if (a.domain !== b.domain) {
- 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"