igor-starostenko/report_factory-web

View on GitHub

Showing 232 of 232 total issues

Function UpdatePasswordForm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function UpdatePasswordForm(props) {
  useEffect(() => () => props.resetMe(), []);

  const { editUser, handleSubmit } = props;
  const errors = getValue(editUser, 'error');
Severity: Minor
Found in src/containers/update_password_form.jsx - About 1 hr to fix

    Function RspecReportsList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function RspecReportsList(props) {
      const { edges } = props;
      const reports = edges.map(edge => edge.node);
    
      if (isEmpty(reports)) {
    Severity: Minor
    Found in src/components/rspec_reports_list.jsx - About 1 hr to fix

      Function getPages has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getPages(currentPage, lastPage) {
        const pages = [];
        const startPage = 1;
        pages.push({ page: startPage, start: true });
        if (lastPage > 3) {
      Severity: Minor
      Found in src/components/pagination_connection.jsx - About 1 hr to fix

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

            if (currentPage === startPage) {
              // 1, 2, '...', 148
              pages.push({ page: currentPage + 1, next: true });
              pages.push({ page: currentPage + 2, ellipsis: true });
            } else if (currentPage - 1 === startPage) {
        Severity: Major
        Found in src/components/pagination_connection.jsx and 1 other location - About 1 hr to fix
        src/components/pagination_connection.jsx on lines 31..35

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

        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

            } else {
              // 1, '...', 147, 148
              pages.push({ page: currentPage - 2, ellipsis: true });
              pages.push({ page: currentPage - 1, previous: true });
            }
        Severity: Major
        Found in src/components/pagination_connection.jsx and 1 other location - About 1 hr to fix
        src/components/pagination_connection.jsx on lines 12..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 57.

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

        const validate = ({ name, email, password, type }) => {
          const errors = {};
        
          if (!name) {
            errors.name = "User Name can't be blank";
        Severity: Minor
        Found in src/containers/edit_user_form.jsx - About 1 hr 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 RspecReportRow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function RspecReportRow(props) {
          const {
            id,
            projectName,
            reportableType,
        Severity: Minor
        Found in src/components/rspec_reports_list.jsx - About 1 hr to fix

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

          function App(props) {
            const { xApiKey: storeApiKey, history, userId, loading, children } = props;
            const xApiKey = storeApiKey || Cookies.get('X-API-KEY');
          
            useEffect(() => {
          Severity: Minor
          Found in src/containers/app.jsx - About 1 hr to fix

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

                  <div className={styles.projectChart}>
                    <Line data={props.getChartData} options={props.chartOptions} />
                  </div>
            Severity: Minor
            Found in src/components/project_selection.jsx and 1 other location - About 55 mins to fix
            src/containers/scenarios.jsx on lines 52..54

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

            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

                    <div className={styles.allScenariosSearch}>
                      <SearchScenarios search={props.search} setSearch={props.setSearch} />
                    </div>
            Severity: Minor
            Found in src/containers/scenarios.jsx and 1 other location - About 55 mins to fix
            src/components/project_selection.jsx on lines 15..17

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

            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

                case GET_PROJECT: {
                  const { data } = action.payload;
                  return { ...state, activeProject: { data, error: null, loading: false } };
                }
            Severity: Major
            Found in src/reducers/projects_reducers.js and 2 other locations - About 50 mins to fix
            src/reducers/projects_reducers.js on lines 68..71
            src/reducers/reports_reducers.js on lines 68..74

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

            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

                case GET_RSPEC_REPORT: {
                  const { data } = action.payload;
                  return {
                    ...state,
                    activeRspecReport: { data, error: null, loading: false },
            Severity: Major
            Found in src/reducers/reports_reducers.js and 2 other locations - About 50 mins to fix
            src/reducers/projects_reducers.js on lines 55..58
            src/reducers/projects_reducers.js on lines 68..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 52.

            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

                case EDIT_PROJECT_SUCCESS: {
                  const { data } = action.payload;
                  return { ...state, editProject: { data, error: null, loading: false } };
                }
            Severity: Major
            Found in src/reducers/projects_reducers.js and 2 other locations - About 50 mins to fix
            src/reducers/projects_reducers.js on lines 55..58
            src/reducers/reports_reducers.js on lines 68..74

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

            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

              queryRspecReports(xApiKey, variables) {
                const headers = ApiClient.formatHeaders(xApiKey);
                return this.query({
                  query: `query rspecReportsConnection($first: Int, $last: Int, $before: String, $after: String, $tags: [String], $projectName: String) {
                    rspecReportsConnection(first: $first, last: $last, after: $after, before: $before, tags: $tags, projectName: $projectName) {
            Severity: Minor
            Found in src/api/reports_client.js and 1 other location - About 50 mins to fix
            src/api/reports_client.js on lines 5..40

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

            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

            CreateUser.propTypes = {
              createUser: PropTypes.func.isRequired,
              xApiKey: PropTypes.string.isRequired,
              isAdmin: PropTypes.bool.isRequired,
            };
            Severity: Minor
            Found in src/containers/create_user.jsx and 1 other location - About 50 mins to fix
            src/containers/user.jsx on lines 33..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 51.

            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

            ApiKeyModal.propTypes = {
              isOpen: PropTypes.bool.isRequired,
              toggle: PropTypes.func.isRequired,
              xApiKey: PropTypes.string.isRequired,
            };
            Severity: Minor
            Found in src/containers/user.jsx and 1 other location - About 50 mins to fix
            src/containers/create_user.jsx on lines 31..35

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

            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

              queryReports(xApiKey, variables) {
                const headers = ApiClient.formatHeaders(xApiKey);
                return this.query({
                  query: `query reportsConnection($first: Int, $last: Int, $before: String, $after: String, $tags: [String]) {
                    reportsConnection(first: $first, last: $last, after: $after, before: $before, tags: $tags) {
            Severity: Minor
            Found in src/api/reports_client.js and 1 other location - About 50 mins to fix
            src/api/reports_client.js on lines 43..77

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

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

            function getPages(currentPage, lastPage) {
              const pages = [];
              const startPage = 1;
              pages.push({ page: startPage, start: true });
              if (lastPage > 3) {
            Severity: Minor
            Found in src/components/pagination_connection.jsx - 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

                case EDIT_PROJECT_FAILURE: {
                  const error = action.payload.errors;
                  return { ...state, editProject: { data: null, error, loading: false } };
                }
            Severity: Minor
            Found in src/reducers/projects_reducers.js and 1 other location - About 45 mins to fix
            src/reducers/users_reducers.js on lines 134..137

            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

                case RSPEC_REPORTS_QUERY: {
                  const query = action.payload;
                  const rspecReportsConnection = { ...state.rspecReportsConnection, query };
                  return { ...state, rspecReportsConnection };
                }
            Severity: Minor
            Found in src/reducers/reports_reducers.js and 1 other location - About 45 mins to fix
            src/reducers/project_reports_reducers.js on lines 52..56

            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

            Severity
            Category
            Status
            Source
            Language