eventoL/eventoL

View on GitHub

Showing 519 of 519 total issues

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

    class Meta:
        model = Attendee
        fields = ['first_name', 'last_name', 'nickname', 'email',
                  'additional_info', 'is_installing',
                  'event', 'registration_date']
Severity: Major
Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
eventol/manager/forms.py on lines 158..166

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

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 event_data1 has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

def event_data1(
Severity: Major
Found in eventol/manager/tests/conftest.py - About 1 hr to fix

    Function event_data2 has 13 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def event_data2(
    Severity: Major
    Found in eventol/manager/tests/conftest.py - About 1 hr to fix

      Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const {
            background,
            isMobile,
            languages,
      Severity: Minor
      Found in eventol/front/src/containers/InstanceDetails/index.jsx - About 1 hr to fix

        Function parseTotals has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const parseTotals = allData => {
          const totals = {
            speakers: _.sumBy(allData, 'report.speakers'),
            attendees: {
              confirmed:
        Severity: Minor
        Found in eventol/front/src/utils/report.js - About 1 hr to fix

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

              def signup(self, request, user):
                  user.first_name = self.cleaned_data['first_name']
                  user.last_name = self.cleaned_data['last_name']
                  user.save()
          Severity: Major
          Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
          eventol/manager/forms.py on lines 514..517

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

          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

              def signup(self, request, user):
                  user.first_name = self.cleaned_data['first_name']
                  user.last_name = self.cleaned_data['last_name']
                  user.save()
          Severity: Major
          Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
          eventol/manager/forms.py on lines 454..457

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

          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

              def save(self, *args, **kwargs):
                  """
                  Override default save
          
                  it will add the slug field using slugify.
          Severity: Major
          Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
          eventol/manager/models.py on lines 284..292

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

          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

              def save(self, *args, **kwargs):
                  """
                  Override default save
          
                  it will add the slug field using slugify.
          Severity: Major
          Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
          eventol/manager/models.py on lines 112..120

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

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

          export const getActivitiesColumns = totals => {
            if (!totals.hasOwnProperty('activities')) return {};
            return {
              Header: gettext('Activities'),
              columns: [
          Severity: Minor
          Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

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

              geometry: {
                location: {lat: -34.6052436, lng: -58.388569700000005},
                location_type: 'ROOFTOP',
                viewport: {
                  south: -34.6065925802915,
            Severity: Major
            Found in eventol/front/src/utils/__mock__/data.js and 1 other location - About 1 hr to fix
            eventol/front/src/utils/__mock__/data.js on lines 30..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 65.

            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

              geometry: {
                location: {lat: -32.9586923, lng: -60.629729},
                location_type: 'ROOFTOP',
                viewport: {
                  south: -32.9600412802915,
            Severity: Major
            Found in eventol/front/src/utils/__mock__/data.js and 1 other location - About 1 hr to fix
            eventol/front/src/utils/__mock__/data.js on lines 72..81

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

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

            const TitleList = props => {
              const [data, setData] = useState({results: []});
              const [mounted, setMounted] = useState(false);
              const {title, id, showEmpty, url} = props;
            
            
            Severity: Minor
            Found in eventol/front/src/components/TitleList/index.jsx - About 1 hr to fix

              Function count_by has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              def count_by(elements, getter, increment=None):
                  return_dict = {}
                  for element in elements:
                      try:
                          field = str(getter(element))
              Severity: Minor
              Found in eventol/manager/utils/report.py - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                      if activities_room.filter(
                              end_date__range=(
                                  proposal.start_date + one_second, proposal.end_date - one_second)) \
                              .exclude(pk=proposal.pk).exists() \
              Severity: Major
              Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
              eventol/manager/models.py on lines 921..924

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

              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

                              or activities_room.filter(
                                  start_date__range=(
                                      proposal.start_date + one_second, proposal.end_date - one_second)) \
                                  .exclude(pk=proposal.pk).exists() \
              Severity: Major
              Found in eventol/manager/models.py and 1 other location - About 1 hr to fix
              eventol/manager/models.py on lines 914..917

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

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

                  Formset.prototype.bindForm = function($form, index) {
                      var prefix = this.formsetPrefix + '-' + index;
                      $form.data(pluginName + '__formPrefix', prefix);
              
                      var $delete = $form.find('[name=' + prefix + '-DELETE]');
              Severity: Minor
              Found in eventol/front/src/libs/jquery.formset.js - About 1 hr to fix

                Function getColumns has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getColumns = (table, eventsPrivateData, count, totals) => {
                  const eventColumns = getEventColumns(count);
                  const locationColumns = getLocationColumns();
                  const assistanceConfirmatedColumns = getAssitanceConfirmatedColumns(totals);
                  const activitiesColumns = getActivitiesColumns(totals);
                Severity: Minor
                Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

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

                          for field in self.fields.keys():
                              if field not in self.ordered_field_names:
                                  new_fields[field] = original_fields.get(field)
                  Severity: Major
                  Found in eventol/manager/forms.py and 1 other location - About 1 hr to fix
                  eventol/manager/forms.py on lines 448..450

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

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

                      def clean(self):
                          cleaned_data = super().clean()
                          data_type = cleaned_data.get("type")
                          value = cleaned_data.get("url")
                  
                  
                  Severity: Minor
                  Found in eventol/manager/forms.py - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language