FredericHeem/starhackit

View on GitHub

Showing 270 of 270 total issues

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

      {
        pathname: "/:git_credential_id",
        method: "patch",
        handler: (context) =>
          pipe([
Severity: Major
Found in server/src/plugins/cloudDiagram/api/gitCredentialApi.js and 2 other locations - About 3 hrs to fix
server/src/plugins/cloudDiagram/api/gitRepositoryApi.js on lines 108..125
server/src/plugins/cloudDiagram/api/workspaceApi.js on lines 121..138

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

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

export const gcpFormCreate = (context) => {
  const { tr } = context;
  const FormCreate = providerFormCreate(context);

  const FileInput = fileInput(context);
Severity: Major
Found in client/src/app_infra/infra/gcpConfig.js - About 3 hrs to fix

    File AuthenticationRouter.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const assert = require("assert");
    const { omit, get, tryCatch, pipe } = require("rubico");
    const { callProp } = require("rubico/x");
    
    const _ = require("lodash");
    Severity: Minor
    Found in server/src/plugins/users/authentication/AuthenticationRouter.js - About 3 hrs to fix

      Function createInfraItem has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const createInfraItem = (context) => {
        const { tr, history, rest, theme } = context;
      
        const { palette } = theme;
        const BadgeRegion = badgeRegion(context);
      Severity: Major
      Found in client/src/app_infra/infra/infraList.js - About 3 hrs to fix

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

              <FormGroup>
                <Input
                  name="OS_PASSWORD"
                  value={store.data.OS_PASSWORD}
                  onChange={(event) => store.onChange("OS_PASSWORD", event)}
        Severity: Major
        Found in client/src/app_infra/infra/ovhConfig.js and 1 other location - About 3 hrs to fix
        client/src/app_infra/infra/awsConfig.js on lines 128..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 99.

        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

              <FormGroup>
                <Input
                  name="AWSSecretKey"
                  value={store.data.AWSSecretKey}
                  onChange={(event) => store.onChange("AWSSecretKey", event)}
        Severity: Major
        Found in client/src/app_infra/infra/awsConfig.js and 1 other location - About 3 hrs to fix
        client/src/app_infra/infra/ovhConfig.js on lines 162..171

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

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

          function Stores() {
            const infraStore = observable({
              errors: {},
              opGet: asyncOpCreate(() => rest.get("infra")),
              get: action(async function () {
        Severity: Major
        Found in client/src/app_infra/infra/infraModule.js - About 3 hrs to fix

          Function exports has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
            const configuration = {
              browsers: ["Chrome_without_security"],
              customLaunchers: {
                Chrome_without_security: {
          Severity: Major
          Found in client/karma.conf.js - About 3 hrs to fix

            Function Stores has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function Stores() {
                const profileStore = observable({
                  language: "US",
                  errors: {},
                  username: "",
            Severity: Major
            Found in client/src/app_infra/profile/profileModule.js - About 2 hrs to fix

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

                    models.Infra.findOne({
                      include: [
                        {
                          model: models.Job,
                          limit: 1,
              Severity: Major
              Found in server/src/plugins/cloudDiagram/api/infraApi.js and 1 other location - About 2 hrs to fix
              server/src/plugins/cloudDiagram/api/infraApi.js on lines 48..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 94.

              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

                      model.findAll({
                        include: [
                          {
                            model: models.Job,
                            limit: 1,
              Severity: Major
              Found in server/src/plugins/cloudDiagram/api/infraApi.js and 1 other location - About 2 hrs to fix
              server/src/plugins/cloudDiagram/api/infraApi.js on lines 14..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 94.

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

              export const createInfraList = (context) => {
                const { tr, history } = context;
                const Form = createForm(context);
                const Page = page(context);
                const Button = button(context, {
              Severity: Major
              Found in client/src/app_infra/infra/infraList.js - About 2 hrs to fix

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

                  const sgRuleIngressHttps = provider.EC2.makeSecurityGroupRuleIngress({
                    name: "sg-rule-ingress-https",
                    dependencies: {
                      securityGroup,
                    },
                Severity: Major
                Found in deploy/grucloud-aws/iac.js and 2 other locations - About 2 hrs to fix
                deploy/grucloud-aws/iac.js on lines 51..73
                deploy/grucloud-aws/iac.js on lines 74..96

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

                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

                  const sgRuleIngressHttp = provider.EC2.makeSecurityGroupRuleIngress({
                    name: "sg-rule-ingress-http",
                    dependencies: {
                      securityGroup,
                    },
                Severity: Major
                Found in deploy/grucloud-aws/iac.js and 2 other locations - About 2 hrs to fix
                deploy/grucloud-aws/iac.js on lines 51..73
                deploy/grucloud-aws/iac.js on lines 97..119

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

                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

                  const sgRuleIngressSsh = provider.EC2.makeSecurityGroupRuleIngress({
                    name: "sg-rule-ingress-ssh",
                    dependencies: {
                      securityGroup,
                    },
                Severity: Major
                Found in deploy/grucloud-aws/iac.js and 2 other locations - About 2 hrs to fix
                deploy/grucloud-aws/iac.js on lines 74..96
                deploy/grucloud-aws/iac.js on lines 97..119

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

                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

                  if (_.get(config, "authentication.facebook")) {
                    const registerWeb = require("./auth-strategy/FacebookStrategy").registerWeb;
                    registerWeb({ passport, models, publisher });
                    const registerMobile =
                      require("./auth-strategy/FacebookStrategy").registerMobile;
                Severity: Major
                Found in server/src/plugins/users/PassportAuth.js and 1 other location - About 2 hrs to fix
                server/src/plugins/users/PassportAuth.js on lines 21..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 92.

                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 default (context) => {
                  const Item = ({ item }) => (
                    <div
                      css={css`
                        display: flex;
                Severity: Major
                Found in client/src/app_infra/infra/ovhSelectRegion.js and 1 other location - About 2 hrs to fix
                client/src/app_infra/infra/SelectRegion.js on lines 5..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 92.

                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 default (context, { items } = {}) => {
                  const Item = ({ item }) => (
                    <div
                      css={css`
                        display: flex;
                Severity: Major
                Found in client/src/app_infra/infra/SelectRegion.js and 1 other location - About 2 hrs to fix
                client/src/app_infra/infra/ovhSelectRegion.js on lines 19..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 92.

                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

                  if (_.get(config, "authentication.google")) {
                    const registerWeb = require("./auth-strategy/GoogleStrategy").registerWeb;
                    registerWeb({ passport, models, publisher });
                    const registerMobile =
                      require("./auth-strategy/GoogleStrategy").registerMobile;
                Severity: Major
                Found in server/src/plugins/users/PassportAuth.js and 1 other location - About 2 hrs to fix
                server/src/plugins/users/PassportAuth.js on lines 13..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 92.

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

                export const importProjectForm = (context) => {
                  const { tr, theme, emitter } = context;
                  const ImportTypeItem = importTypeItem(context);
                  const Form = form(context);
                  const ButtonHistoryBack = buttonHistoryBack(context);
                Severity: Major
                Found in client/src/app_infra/infra/importProjectForm.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language