igor-starostenko/report_factory-web

View on GitHub

Showing 232 of 232 total issues

Function Users has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Users(props) {
  const { xApiKey, users, isAdmin } = props;

  useEffect(() => {
    props.getUsers(xApiKey);
Severity: Minor
Found in src/containers/users.jsx - About 1 hr to fix

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

    export default function RspecReportExamplesList(props) {
      const { examples } = props;
    
      if (!examples) {
        return <Loading />;
    Severity: Minor
    Found in src/components/rspec_report_examples_list.jsx - About 1 hr to fix

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

      function RspecReport(props) {
        const { report, reportId, xApiKey } = props;
      
        useEffect(() => {
          if (!report || report.id !== reportId) {
      Severity: Minor
      Found in src/containers/rspec_report.jsx - About 1 hr to fix

        Function queryReports has 34 lines of code (exceeds 25 allowed). 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 - About 1 hr to fix

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

            tooltips: {
              callbacks: {
                label: formatTooltip,
              },
              itemSort: (a, b) => (a.datasetIndex > b.datasetIndex ? -1 : 1),
          Severity: Major
          Found in src/components/reports_line_chart.jsx and 1 other location - About 1 hr to fix
          src/containers/projects.jsx on lines 84..92

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

          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

            tooltips: {
              callbacks: {
                label: formatTooltip,
              },
              itemSort: (a, b) => (a.datasetIndex > b.datasetIndex ? -1 : 1),
          Severity: Major
          Found in src/containers/projects.jsx and 1 other location - About 1 hr to fix
          src/components/reports_line_chart.jsx on lines 127..135

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

          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

            queryScenario(projectName, scenarioName, xApiKey) {
              const headers = ApiClient.formatHeaders(xApiKey);
              return this.query({
                query: `query scenario($projectName: String!, $scenarioName: String!){
                  scenario(projectName: $projectName,
          Severity: Major
          Found in src/api/scenarios_client.js and 1 other location - About 1 hr to fix
          src/api/projects_client.js on lines 4..19

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

          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

            queryProjects(xApiKey, { lastDays, lastMonths } = {}) {
              const headers = ApiClient.formatHeaders(xApiKey);
              return this.query({
                query: `query projects($lastDays: Int, $lastMonths: Int) {
                  projects {
          Severity: Major
          Found in src/api/projects_client.js and 1 other location - About 1 hr to fix
          src/api/scenarios_client.js on lines 18..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 62.

          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 queryRspecReports has 33 lines of code (exceeds 25 allowed). 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 - About 1 hr to fix

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

            const options = {
              responsive: true,
              maintainAspectRatio: true,
              tooltips: {
                callbacks: { label: formatTooltip },
            Severity: Major
            Found in src/components/rspec_feature_chart.jsx and 1 other location - About 1 hr to fix
            src/components/scenario_success_chart.jsx on lines 14..26

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

            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

              query: PropTypes.shape({
                page: PropTypes.number.isRequired,
                perPage: PropTypes.number.isRequired,
                query: PropTypes.arrayOf(PropTypes.string),
              }).isRequired,
            Severity: Major
            Found in src/containers/reports.jsx and 1 other location - About 1 hr to fix
            src/containers/project_rspec_reports.jsx on lines 111..115

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

            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

              query: PropTypes.shape({
                page: PropTypes.number.isRequired,
                perPage: PropTypes.number.isRequired,
                query: PropTypes.arrayOf(PropTypes.string),
              }).isRequired,
            Severity: Major
            Found in src/containers/project_rspec_reports.jsx and 1 other location - About 1 hr to fix
            src/containers/reports.jsx on lines 95..99

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

            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 options = {
              responsive: true,
              maintainAspectRatio: false,
              tooltips: {
                callbacks: { label: formatTooltip },
            Severity: Major
            Found in src/components/scenario_success_chart.jsx and 1 other location - About 1 hr to fix
            src/components/rspec_feature_chart.jsx on lines 20..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 61.

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

            function Home(props) {
              const isLoggedIn = !!(props.xApiKey || Cookies.get('X-API-KEY'));
              const imageSrc = '/style/assets/img/rf-apple-icon.png';
            
              return (
            Severity: Minor
            Found in src/containers/home.jsx - About 1 hr to fix

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

              export default function RspecReportDetails(props) {
                const {
                  date,
                  summary,
                  project_name: projectName,
              Severity: Minor
              Found in src/components/rspec_report_details.jsx - About 1 hr to fix

                Function UpdatePasswordModal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function UpdatePasswordModal(props) {
                  function resetForm() {
                    props.dispatch(reset('editPasswordForm'));
                    props.toggle();
                  }
                Severity: Minor
                Found in src/containers/update_user.jsx - About 1 hr to fix

                  Function fetchChartData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const fetchChartData = (reports, activeFilter) => {
                    const { units, labels, dataForDate } = chartData[activeFilter]();
                    const failedReports = filterByStatus(reports, 'failed');
                    const passedReports = filterByStatus(reports, 'passed');
                    const failedData = dataForDate(failedReports, units);
                  Severity: Minor
                  Found in src/components/reports_line_chart.jsx - About 1 hr to fix

                    Function LineChart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function LineChart(props) {
                      const {
                        activeFilter,
                        filterMapping,
                        filterAction,
                    Severity: Minor
                    Found in src/components/line_chart.jsx - About 1 hr to fix

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

                        pageInfo: PropTypes.shape({
                          startCursor: PropTypes.string,
                          endCursor: PropTypes.string,
                          hasNextPage: PropTypes.bool.isRequired,
                          hasPreviousPage: PropTypes.bool.isRequired,
                      Severity: Major
                      Found in src/containers/project_rspec_reports.jsx and 1 other location - About 1 hr to fix
                      src/containers/reports.jsx on lines 89..94

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

                      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

                        pageInfo: PropTypes.shape({
                          startCursor: PropTypes.string,
                          endCursor: PropTypes.string,
                          hasNextPage: PropTypes.bool.isRequired,
                          hasPreviousPage: PropTypes.bool.isRequired,
                      Severity: Major
                      Found in src/containers/reports.jsx and 1 other location - About 1 hr to fix
                      src/containers/project_rspec_reports.jsx on lines 104..109

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

                      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