Showing 8 of 48 total issues
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const accessToken = this.props.accessToken ? this.props.accessToken : '';
const formValues: FormValues = {accessToken};
return <FormContainer>
<Formik
Function TrendingReducer
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TrendingReducer = (state = TRENDING_INITIAL_STATE, action): TrendingStore => {
switch (action.type) {
case SET_LANGUAGE_LIST_TYPE:
return {
...state,
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <>
<style>{inputStyle}</style>
<style>{iconStyles}</style>
<Router>
Function createMainWindow
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createMainWindow(options: BrowserWindowConstructorOptions = {}): BrowserWindow {
const baseOptions = this.DEFAULT_OPTIONS;
const { height } = screen.getPrimaryDisplay().workAreaSize;
if (this.lastWindow) {
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <>
<Container>
<Topbar>
<LanguageListPicker selected={this.state.selectedLanguageListType}
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const title = `Is ${this.repository.isUser ? 'User' : 'Organization'}`;
return (
<Item className='repository-list-item'>
<ItemHeader>
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <>
<Title>About</Title>
<AboutContainer>
<Main>
Function openLinkExternally
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
export const openLinkExternally = (event) => {
let href;
let isExternal = false;
const checkDomElement = (element: Element) => {
- 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"