jasonraimondi/traverse

View on GitHub

Showing 8 of 48 total issues

Function render has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const accessToken = this.props.accessToken ? this.props.accessToken : '';
    const formValues: FormValues = {accessToken};
    return <FormContainer>
      <Formik
Severity: Major
Found in src/renderer/elements/GithubAccessTokenForm.tsx - About 2 hrs to fix

    Function TrendingReducer has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const TrendingReducer = (state = TRENDING_INITIAL_STATE, action): TrendingStore => {
      switch (action.type) {
        case SET_LANGUAGE_LIST_TYPE:
          return {
            ...state,
    Severity: Major
    Found in src/renderer/store/Trending/Reducer.ts - About 2 hrs to fix

      Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          return <>
            <style>{inputStyle}</style>
            <style>{iconStyles}</style>
            <Router>
      Severity: Minor
      Found in src/renderer/App.tsx - About 1 hr to fix

        Function createMainWindow has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          createMainWindow(options: BrowserWindowConstructorOptions = {}): BrowserWindow {
            const baseOptions = this.DEFAULT_OPTIONS;
            const { height } = screen.getPrimaryDisplay().workAreaSize;
        
            if (this.lastWindow) {
        Severity: Minor
        Found in src/main/WindowManager.ts - About 1 hr to fix

          Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              return <>
                <Container>
                  <Topbar>
                    <LanguageListPicker selected={this.state.selectedLanguageListType}
          Severity: Minor
          Found in src/renderer/app/TrendingRepos/TrendingRepos.tsx - About 1 hr to fix

            Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const title = `Is ${this.repository.isUser ? 'User' : 'Organization'}`;
                return (
                  <Item className='repository-list-item'>
                    <ItemHeader>
            Severity: Minor
            Found in src/renderer/app/TrendingRepos/components/RepositoryDetail.tsx - About 1 hr to fix

              Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  return <>
                    <Title>About</Title>
                    <AboutContainer>
                      <Main>
              Severity: Minor
              Found in src/renderer/app/About/About.tsx - About 1 hr to fix

                Function openLinkExternally has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                export const openLinkExternally = (event) => {
                  let href;
                  let isExternal = false;
                
                  const checkDomElement = (element: Element) => {
                Severity: Minor
                Found in src/main/OpenLinkExternally.ts - About 45 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language