FredericHeem/starhackit

View on GitHub

Showing 270 of 270 total issues

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

      <Button
        data-button-select-google
        raised
        onClick={() => store.selectProvider({ providerName: "google" })}
      >
Severity: Major
Found in client/src/app_infra/infra/providerSelection.js and 2 other locations - About 1 hr to fix
client/src/app_infra/infra/providerSelection.js on lines 55..61
client/src/app_infra/infra/providerSelection.js on lines 69..75

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

    locales.forEach(locale => {
      const formatter = Formatter(locale);
      console.log(formatter.money1(EUR100));
      assert(formatter.money(EUR100));
    });
Severity: Major
Found in mobile/src/core/Formatter.test.js and 1 other location - About 1 hr to fix
mobile/src/core/Formatter.test.js on lines 13..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 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 3 locations. Consider refactoring.
Open

      <Button
        data-button-select-azure
        raised
        onClick={() => store.selectProvider({ providerName: "azure" })}
      >
Severity: Major
Found in client/src/app_infra/infra/providerSelection.js and 2 other locations - About 1 hr to fix
client/src/app_infra/infra/providerSelection.js on lines 55..61
client/src/app_infra/infra/providerSelection.js on lines 62..68

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 3 locations. Consider refactoring.
Open

const rules = {
  name: {
    presence: true,
    length: {
      minimum: 2,
Severity: Major
Found in client/src/app_infra/infra/infraSettings.js and 2 other locations - About 1 hr to fix
client/src/app_infra/infra/awsConfig.js on lines 41..56
client/src/app_infra/infra/gitCredentialConfig.js on lines 17..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 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 3 locations. Consider refactoring.
Open

      <Button
        data-button-select-aws
        raised
        onClick={() => store.selectProvider({ providerName: "aws" })}
      >
Severity: Major
Found in client/src/app_infra/infra/providerSelection.js and 2 other locations - About 1 hr to fix
client/src/app_infra/infra/providerSelection.js on lines 62..68
client/src/app_infra/infra/providerSelection.js on lines 69..75

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

    async resetPassword(payload) {
      validateJson(payload, require("./schema/resetPassword.json"));
      let email = payload.email;
      log.info("resetPassword: ", email);

Severity: Minor
Found in server/src/plugins/users/authentication/AuthenticationApi.js - About 1 hr to fix

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

              <FormGroup>
                <Button
                  className="btn-update-profile"
                  raised
                  onClick={() => store.update()}
    Severity: Major
    Found in client/src/app_user/profile/components/profileForm.js and 1 other location - About 1 hr to fix
    client/src/app_infra/profile/components/profileForm.js on lines 101..108

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

    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

              <FormGroup>
                <Button
                  className="btn-update-profile"
                  raised
                  onClick={() => store.update()}
    Severity: Major
    Found in client/src/app_infra/profile/components/profileForm.js and 1 other location - About 1 hr to fix
    client/src/app_user/profile/components/profileForm.js on lines 81..88

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

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

    function App() {
      let data = Data(config);
      const publisher = Store(config);
    
      let app = {
    Severity: Minor
    Found in server/src/app.js - About 1 hr to fix

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

        load() {
          debug("load");
          return new Promise((resolve /*, reject*/) => {
            i18next.on("languageChanged", function (lng) {
              debug("languageChanged to ", lng);
      Severity: Minor
      Found in client/src/utils/i18n.js - About 1 hr to fix

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

        export const providerConfigCreateFooter = (context) => {
          const {
            tr,
            history,
            theme: { palette },
        Severity: Minor
        Found in client/src/app_infra/infra/providerConfigCommon.js - About 1 hr to fix

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

          module.exports = function(sequelize, DataTypes) {
            const PushToken = sequelize.define(
              "PushToken",
              {
                token: {
          Severity: Minor
          Found in server/src/plugins/expoPush/PushTokenModel.js - About 1 hr to fix

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

              return function ComponentGuide() {
                //console.log("ComponentGuide")
            
                return (
                  <GuideView>
            Severity: Minor
            Found in client/src/components/componentGuide.js - About 1 hr to fix

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

              function UserPlugin(app) {
                let log = require("logfilename")(__filename);
                const { sql } = app.data;
                const sqlAdaptor = require("utils/SqlAdapter")({ sql });
                const models = {
              Severity: Minor
              Found in server/src/plugins/users/index.js - About 1 hr to fix

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

                  function Routes(stores) {
                    return [
                      {
                        path: "",
                        protected: true,
                Severity: Minor
                Found in client/src/app_admin/users/usersModule.js - About 1 hr to fix

                  Function DbSchemaPlugin has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function DbSchemaPlugin(app){
                    log.debug("DbSchemaPlugin ");
                  
                    function DbSchemaHttpController(){
                      return {
                  Severity: Minor
                  Found in server/src/plugins/dbSchema/index.js - About 1 hr to fix

                    Function ajax has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function ajax(url, method, data, params) {
                        console.log(
                          `ajax url: ${baseUrl(url)}, method: ${method}, data ${JSON.stringify(
                            data
                          )}, params: ${JSON.stringify(params)}`
                    Severity: Minor
                    Found in mobile/src/core/rest.js - About 1 hr to fix

                      Function ajax has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function ajax(url, method, data, params, headers = headersDefault) {
                          const jwt = localStorage.getItem("JWT");
                          if (jwt) {
                            headers.Authorization = `Bearer ${jwt}`;
                          }
                      Severity: Minor
                      Found in client/src/utils/rest.js - About 1 hr to fix

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

                              <FormGroup className="aws-region">
                                <AwsSelectRegion
                                  placeholder="Select a region"
                                  value={store.data.AWS_REGION}
                                  onSelected={(region) => {
                        Severity: Major
                        Found in client/src/app_infra/infra/awsConfig.js and 1 other location - About 1 hr to fix
                        client/src/app_infra/infra/ovhConfig.js on lines 172..180

                        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

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

                              <FormGroup>
                                <OvhSelectRegion
                                  placeholder="Select a region"
                                  value={store.data.OS_REGION_NAME}
                                  onSelected={(region) => {
                        Severity: Major
                        Found in client/src/app_infra/infra/ovhConfig.js and 1 other location - About 1 hr to fix
                        client/src/app_infra/infra/awsConfig.js on lines 138..146

                        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