igor-starostenko/report_factory-web

View on GitHub

Showing 232 of 232 total issues

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

  return map(details, (value, key) => (
    <div className={styles.exampleDetailsRow} key={key}>
      <div className={styles.exampleDetailsParam}>{key}:</div>
      <div className={styles.exampleDetailsValue}>{value}</div>
    </div>
Severity: Major
Found in src/components/rspec_report_examples_list.jsx and 1 other location - About 2 hrs to fix
src/components/rspec_report_details.jsx on lines 34..39

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

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

      {map(details, (value, key) => (
        <div className={styles.reportDetailsRow} key={key}>
          <div className={styles.reportDetailsParam}>{key}:</div>
          <div className={styles.reportDetailsValue}>{value}</div>
        </div>
Severity: Major
Found in src/components/rspec_report_details.jsx and 1 other location - About 2 hrs to fix
src/components/rspec_report_examples_list.jsx on lines 42..47

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

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 Projects has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Projects(props) {
  const { xApiKey, projects, isAdmin, loaded } = props;

  useEffect(() => {
    props.queryProjects(xApiKey, { lastDays: days });
Severity: Major
Found in src/containers/projects.jsx - About 2 hrs to fix

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

      getReports(xApiKey, options) {
        const url = `${this.baseUrl}api/v1/reports`;
        const params = this.constructor.formatQuery(options);
        const headers = ApiClient.formatHeaders(xApiKey);
        return fetch(new Request(url + params, { method: 'GET', headers }));
    Severity: Major
    Found in src/api/reports_client.js and 1 other location - About 2 hrs to fix
    src/api/reports_client.js on lines 86..91

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

    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

      getRspecReports(xApiKey, options) {
        const url = `${this.baseUrl}api/v1/reports/rspec`;
        const params = this.constructor.formatQuery(options);
        const headers = ApiClient.formatHeaders(xApiKey);
        return fetch(new Request(url + params, { method: 'GET', headers }));
    Severity: Major
    Found in src/api/reports_client.js and 1 other location - About 2 hrs to fix
    src/api/reports_client.js on lines 79..84

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

    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 EditUserForm has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function EditUserForm(props) {
      const {
        isAdmin,
        isCurrent,
        handleSubmit,
    Severity: Major
    Found in src/containers/edit_user_form.jsx - About 2 hrs to fix

      Function ProjectRspecReports has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ProjectRspecReports(props) {
        const { edges, pageInfo, projectName, query, totalCount, xApiKey } = props;
      
        function fetchProjectRspecReports(options) {
          if (query.page !== options.page) {
      Severity: Major
      Found in src/containers/project_rspec_reports.jsx - About 2 hrs to fix

        Function ScenariosList has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function ScenariosList(props) {
            const [scenarios, setScenarios] = useState([]);
            const [page, setPage] = useState(1);
            const [perPage, setPerPage] = useState(10);
            const [total, setTotal] = useState(0);
        Severity: Major
        Found in src/components/scenarios_list.jsx - About 2 hrs to fix

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

              data: PropTypes.shape({
                id: PropTypes.string.isRequired,
                type: PropTypes.string.isRequired,
                attributes: PropTypes.shape({
                  name: PropTypes.string.isRequired,
          Severity: Major
          Found in src/containers/update_password_form.jsx and 1 other location - About 2 hrs to fix
          src/containers/update_user.jsx on lines 207..214

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

          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

              data: PropTypes.shape({
                id: PropTypes.string.isRequired,
                type: PropTypes.string.isRequired,
                attributes: PropTypes.shape({
                  name: PropTypes.string.isRequired,
          Severity: Major
          Found in src/containers/update_user.jsx and 1 other location - About 2 hrs to fix
          src/containers/update_password_form.jsx on lines 63..70

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

          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

              cy.get('h1')
                .invoke('text')
                .then(projectName => {
                  expect(projectName).to.be.a('String');
                  cy.url().should('include', `projects/${projectName}`);
          Severity: Major
          Found in cypress/integration/e2e_spec.js and 1 other location - About 2 hrs to fix
          cypress/integration/e2e_spec.js on lines 57..62

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

          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

              cy.get('h1')
                .invoke('text')
                .then(projectName => {
                  expect(projectName).to.be.a('String');
                  cy.url().should('include', `projects/${projectName}/rspec`);
          Severity: Major
          Found in cypress/integration/e2e_spec.js and 1 other location - About 2 hrs to fix
          cypress/integration/e2e_spec.js on lines 45..50

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

          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 UpdateProject has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function UpdateProject(props) {
            const [isDeleteProjectModalOpen, setDeleteProjectModel] = useState(false);
            const { dispatch, isAdmin, project, projectName, xApiKey } = props;
            const hasSameProject = hasProject(project, projectName);
          
          
          Severity: Major
          Found in src/containers/update_project.jsx - About 2 hrs to fix

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

              function fetchUserReports({ filterName, lastDays, lastMonths }) {
                props.setUserReportsFilters(userId, {
                  filterName,
                  lastDays,
                  lastMonths,
            Severity: Major
            Found in src/containers/user.jsx and 1 other location - About 2 hrs to fix
            src/containers/project.jsx on lines 20..27

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

            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

              function filterProject({ filterName, lastDays, lastMonths }) {
                props.setProjectFilters(projectName, {
                  filterName,
                  lastDays,
                  lastMonths,
            Severity: Major
            Found in src/containers/project.jsx and 1 other location - About 2 hrs to fix
            src/containers/user.jsx on lines 57..64

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

            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 Reports has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Reports(props) {
              const { edges, pageInfo, query, totalCount, xApiKey } = props;
            
              function fetchRspecReports(options) {
                if (query.page !== options.page) {
            Severity: Major
            Found in src/containers/reports.jsx - About 2 hrs to fix

              Function Scenarios has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function Scenarios(props) {
                const {
                  xApiKey,
                  scenarios,
                  scenariosList,
              Severity: Major
              Found in src/containers/scenarios.jsx - About 2 hrs to fix

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

                const mapDispatchToProps = dispatch => ({
                  getProject: (...args) => dispatch(getProject(...args)),
                  updateProject: (...args) => dispatch(updateProject(...args)),
                  deleteProject: (...args) => dispatch(deleteProject(...args)),
                  dispatch,
                Severity: Major
                Found in src/containers/update_project.jsx and 1 other location - About 2 hrs to fix
                src/containers/update_user.jsx on lines 237..242

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

                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 mapDispatchToProps = dispatch => ({
                  getUser: (...args) => dispatch(getUser(...args)),
                  updateUser: (...args) => dispatch(updateUser(...args)),
                  deleteUser: (...args) => dispatch(deleteUser(...args)),
                  dispatch,
                Severity: Major
                Found in src/containers/update_user.jsx and 1 other location - About 2 hrs to fix
                src/containers/update_project.jsx on lines 148..153

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

                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 Project has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Project(props) {
                  const { project, projectName, filters, xApiKey, scenariosDetails } = props;
                
                  function filterProject({ filterName, lastDays, lastMonths }) {
                    props.setProjectFilters(projectName, {
                Severity: Major
                Found in src/containers/project.jsx - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language