jasonraimondi/traverse

View on GitHub

Showing 48 of 48 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const Clear = styled.span`
  float: right;
  border-color: ${themeConfig.colors.purple};
  color: ${themeConfig.colors.purple};
  &:hover {
Severity: Major
Found in src/renderer/elements/GithubAccessTokenForm.tsx and 1 other location - About 1 hr to fix
src/renderer/App.tsx on lines 66..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const Main = styled.main`
  height: 100%;
  width: 100%;
  display: grid;
  grid-gap: 0;
Severity: Major
Found in src/renderer/App.tsx and 1 other location - About 1 hr to fix
src/renderer/elements/GithubAccessTokenForm.tsx on lines 136..144

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  private get language() {
    const language = this.attributes && this.attributes.language ? this.attributes.language : 'Unknown';
    return <Language className='language'>{language}</Language>;
  }
src/renderer/app/TrendingRepos/components/RepositoryDetail.tsx on lines 29..32

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  private get name() {
    const name = this.attributes && this.attributes.name ? this.attributes.name : 'Unknown';
    return <Name className='name'>{name}</Name>;
  }
src/renderer/app/TrendingRepos/components/RepositoryDetail.tsx on lines 34..37

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 66.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    function fetchUserDetails(username: string) {
      const githubService = container.get<GithubService>(TYPES.GithubService);
      githubService.setAccessTokenFromStore();
      return githubService.user.getUserDetail(username);
    }
    src/renderer/store/Stargazer/sagas/FetchUserStarredRepositoryListSaga.ts on lines 34..38
    src/renderer/store/Stargazer/sagas/FetchUserStarredRepositoryListSaga.ts on lines 40..44

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    function fetchStarredRepositoryList(username: string) {
      const githubService = container.get<GithubService>(TYPES.GithubService);
      githubService.setAccessTokenFromStore();
      return githubService.user.listStarred(username);
    }
    src/renderer/store/Stargazer/sagas/AddUserToStargazerListSaga.ts on lines 25..29
    src/renderer/store/Stargazer/sagas/FetchUserStarredRepositoryListSaga.ts on lines 34..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 63.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

      function fetchUserDetails(username: string) {
        const githubService = container.get<GithubService>(TYPES.GithubService);
        githubService.setAccessTokenFromStore();
        return githubService.user.getUserDetail(username);
      }
      src/renderer/store/Stargazer/sagas/AddUserToStargazerListSaga.ts on lines 25..29
      src/renderer/store/Stargazer/sagas/FetchUserStarredRepositoryListSaga.ts on lines 40..44

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 63.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          const Container = styled.div`
            width: 100%;
            background-color: ${themeConfig.colors.greyLightest};
            overflow-y: auto;
            & ul {
          Severity: Major
          Found in src/renderer/elements/UserStarredRepositoryList.tsx and 3 other locations - About 1 hr to fix
          src/renderer/app/TrendingRepos/components/DiceRoller.tsx on lines 60..76
          src/renderer/elements/Form.ts on lines 48..61
          src/renderer/elements/Title.tsx on lines 21..29

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          export const HollowButtonPrimary = styled.button`
            border-radius: 999px;
            font-size: 0.8rem;
            font-weight: 700;
            display: block;
          Severity: Major
          Found in src/renderer/elements/Form.ts and 3 other locations - About 1 hr to fix
          src/renderer/app/TrendingRepos/components/DiceRoller.tsx on lines 60..76
          src/renderer/elements/Title.tsx on lines 21..29
          src/renderer/elements/UserStarredRepositoryList.tsx on lines 63..71

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          const DiceIcon = styled.a`
            margin-right: 0.5rem;
            & svg {
              width: 1.5rem;
              height: 1.5rem;
          Severity: Major
          Found in src/renderer/app/TrendingRepos/components/DiceRoller.tsx and 3 other locations - About 1 hr to fix
          src/renderer/elements/Form.ts on lines 48..61
          src/renderer/elements/Title.tsx on lines 21..29
          src/renderer/elements/UserStarredRepositoryList.tsx on lines 63..71

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

          const TitleContainer = styled.div`
            grid-area: title;
            z-index: 10;
            height: ${themeConfig.sizes.topbarHeight}px;
            background-color: ${themeConfig.colors.purple};
          Severity: Major
          Found in src/renderer/elements/Title.tsx and 3 other locations - About 1 hr to fix
          src/renderer/app/TrendingRepos/components/DiceRoller.tsx on lines 60..76
          src/renderer/elements/Form.ts on lines 48..61
          src/renderer/elements/UserStarredRepositoryList.tsx on lines 63..71

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 56.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                initialState = {
                  options: {
                    language: {
                      title: 'TypeScript',
                      value: 'typescript',
            Severity: Minor
            Found in src/renderer/store/Trending/Reducer.test.ts and 1 other location - About 45 mins to fix
            src/renderer/store/Trending/Reducer.ts on lines 12..24

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 50.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export const TRENDING_INITIAL_STATE: TrendingStore = {
              options: {
                language: {
                  title: 'TypeScript',
                  value: 'typescript',
            Severity: Minor
            Found in src/renderer/store/Trending/Reducer.ts and 1 other location - About 45 mins to fix
            src/renderer/store/Trending/Reducer.test.ts on lines 10..22

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 50.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            export function SetGithubAccessTokenFailureReducer(state, action) {
              return {
                ...state,
                github: {
                  ...state.github,
            Severity: Minor
            Found in src/renderer/store/Settings/Effect.ts and 1 other location - About 40 mins to fix
            src/renderer/store/Settings/Effect.ts on lines 37..48

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 49.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language