Showing 57 of 57 total issues

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

function askQuestions() {
  const questions = [
    {
      name: 'filename',
      type: 'input',
Severity: Minor
Found in helper_scripts/CL_commands/create_container.js - About 1 hr to fix

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

        {!authenticated && (
          <Link prefetch route="signup" passHref>
            <A active={pathname === '/sign_up'}>SignUp</A>
          </Link>
        )}
    Severity: Major
    Found in components/LinkList/index.js and 1 other location - About 1 hr to fix
    components/LinkList/index.js on lines 21..25

    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 55.

    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

        {!authenticated && (
          <Link prefetch route="signin" passHref>
            <A active={pathname === '/sign_in'}>SignIn</A>
          </Link>
        )}
    Severity: Major
    Found in components/LinkList/index.js and 1 other location - About 1 hr to fix
    components/LinkList/index.js on lines 26..30

    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 55.

    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 getFilesOnDir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    modules.getFilesOnDir = function getFilesOnDir(startPath) {
      if (!fs.existsSync(startPath)) {
        return [];
      }
    
    
    Severity: Minor
    Found in helper_scripts/CL_commands/__helpers.js - About 55 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

    Function askQuestions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function askQuestions() {
      const questions = [
        {
          name: 'filename',
          type: 'input',
    Severity: Minor
    Found in helper_scripts/CL_commands/create_container.js - About 55 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

    Avoid deeply nested control flow statements.
    Open

              if (toString.call(src[p]) === '[object Object]') {
                dst[p] = mergeObjects(dst[p] || {}, src[p]);
              } else {
                dst[p] = src[p];
              }
    Severity: Major
    Found in libraries/helpers.js - About 45 mins to fix

      Function addTexttoFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        filePath,
        from,
        text,
        cb,
        before = true
      Severity: Minor
      Found in helper_scripts/CL_commands/__helpers.js - About 35 mins to fix

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

        export const A = styled(T.A)`
          font-size: 14px;
          margin-right: 15px;
          cursor: pointer;
          text-decoration: ${({ active }) => (active ? 'underline' : 'none')};
        Severity: Minor
        Found in components/LinkList/styles.js and 1 other location - About 35 mins to fix
        components/LinkList/styles.js on lines 11..16

        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 47.

        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 LogOutButton = styled(T.Button)`
          display: inline-block;
          margin-right: 15px;
          cursor: pointer;
          text-decoration: ${({ active }) => (active ? 'underline' : 'none')};
        Severity: Minor
        Found in components/LinkList/styles.js and 1 other location - About 35 mins to fix
        components/LinkList/styles.js on lines 4..9

        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 47.

        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

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

            this.props.mutations
              .signUp(valuesPack)
              .then(
                (response: {
                  data: {
        Severity: Minor
        Found in components/SignUpForm/index.js and 1 other location - About 35 mins to fix
        components/SignInForm/index.js on lines 88..97

        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 47.

        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

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

            this.props.mutations
              .signIn(valuesPack)
              .then((response: { data: { signinUser: { token: string } } }) => {
                if (response.data) {
                  this.props.actions.signIn(response.data.signinUser.token);
        Severity: Minor
        Found in components/SignInForm/index.js and 1 other location - About 35 mins to fix
        components/SignUpForm/index.js on lines 90..110

        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 47.

        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 PostList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const PostList = ({ data, loadMorePosts }: Props) => {
          if (data.allPosts && data.allPosts.length) {
            const areMorePosts = data.allPosts.length < data._allPostsMeta.count;
            return (
              <Main>
        Severity: Minor
        Found in components/PostList/index.js - About 35 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

        Function isUsedOnDir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        modules.isUsedOnDir = function isUsedOnDir(
          startPath,
          filter,
          onlyDirectories = false
        ) {
        Severity: Minor
        Found in helper_scripts/CL_commands/__helpers.js - About 35 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

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

        type State = {
          errors: Object,
          serverErrors: {
            message?: string
          },
        Severity: Minor
        Found in components/SignUpForm/index.js and 1 other location - About 30 mins to fix
        components/SignInForm/index.js on lines 17..25

        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 45.

        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

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

        type State = {
          errors: Object,
          serverErrors: {
            message?: string
          },
        Severity: Minor
        Found in components/SignInForm/index.js and 1 other location - About 30 mins to fix
        components/SignUpForm/index.js on lines 17..25

        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 45.

        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

        formFields should be placed after getServerErrors
        Open

          formFields = [
        Severity: Minor
        Found in components/SignUpForm/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        formFields should be placed after getServerErrors
        Open

          formFields = [
        Severity: Minor
        Found in components/SignInForm/index.js by eslint

        For more information visit Source: http://eslint.org/docs/rules/

        Severity
        Category
        Status
        Source
        Language