masschallenge/django-accelerator

View on GitHub

Showing 137 of 161 total issues

File base_core_profile.py has 595 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from datetime import datetime
from decimal import Decimal
from pytz import utc

import swapper
Severity: Major
Found in accelerator_abstract/models/base_core_profile.py - About 1 day to fix

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

    accelerator/twitter_handle_cleanup/expert_profile_cleanup.py on lines 0..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 111.

    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

    Severity: Major
    Found in accelerator/twitter_handle_cleanup/expert_profile_cleanup.py and 1 other location - About 7 hrs to fix
    accelerator/twitter_handle_cleanup/entrepreneur_profile_cleanup.py on lines 0..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 111.

    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

    def _add_allowed_program_families_to_item(item_props):
        allowed_program_families = item_props.get('program_families', [])
        if not allowed_program_families:
            return
    
    
    Severity: Major
    Found in accelerator/sitetree_navigation/utils.py and 2 other locations - About 5 hrs to fix
    accelerator/sitetree_navigation/utils.py on lines 37..46
    accelerator/sitetree_navigation/utils.py on lines 49..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    def _add_user_roles_to_item(item_props):
        allowed_user_roles = item_props.get('user_roles', [])
        if not allowed_user_roles:
            return
    
    
    Severity: Major
    Found in accelerator/sitetree_navigation/utils.py and 2 other locations - About 5 hrs to fix
    accelerator/sitetree_navigation/utils.py on lines 49..58
    accelerator/sitetree_navigation/utils.py on lines 61..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 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    def _add_allowed_programs_to_item(item_props):
        allowed_programs = item_props.get('programs', [])
        if not allowed_programs:
            return
    
    
    Severity: Major
    Found in accelerator/sitetree_navigation/utils.py and 2 other locations - About 5 hrs to fix
    accelerator/sitetree_navigation/utils.py on lines 37..46
    accelerator/sitetree_navigation/utils.py on lines 61..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 93.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    File core_profile.py has 397 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import swapper
    from django.forms import model_to_dict
    from pytz import utc
    from datetime import (
        datetime,
    Severity: Minor
    Found in accelerator/models/core_profile.py - About 5 hrs to fix

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

      Severity: Major
      Found in accelerator_abstract/models/base_partner_label.py and 1 other location - About 5 hrs to fix
      accelerator_abstract/models/base_startup_label.py on lines 0..21

      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

      Severity: Major
      Found in accelerator_abstract/models/base_startup_label.py and 1 other location - About 5 hrs to fix
      accelerator_abstract/models/base_partner_label.py on lines 0..21

      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

      File __init__.py has 339 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from .base_allocator import BaseAllocator
      from .base_application import (
          APPLICATION_STATUSES,
          BaseApplication,
          COMPLETE_APP_STATUS,
      Severity: Minor
      Found in accelerator_abstract/models/__init__.py - About 4 hrs to fix

        File __init__.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from simpleuser.models import User
        
        from .allocator import Allocator
        from .startup_role import StartupRole
        from .user_role import UserRole
        Severity: Minor
        Found in accelerator/models/__init__.py - About 3 hrs to fix

          User has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class User(AbstractUser):
              # Override the parent email field to add uniqueness constraint
              email = models.EmailField(blank=True, unique=True)
          
              objects = UserManager()
          Severity: Minor
          Found in simpleuser/models.py - About 3 hrs to fix

            BaseCoreProfile has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class BaseCoreProfile(AcceleratorModel):
                user = models.OneToOneField(settings.AUTH_USER_MODEL,
                                            on_delete=models.CASCADE)
                gender_identity = models.ManyToManyField(
                    swapper.get_model_name(
            Severity: Minor
            Found in accelerator_abstract/models/base_core_profile.py - About 2 hrs to fix

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

                  for profile in profile_list:
                      profile = [Model.__name__] + list(profile)
                      profile.append(profile[2][1:])
                      write_to_csv(profile)
              Severity: Major
              Found in accelerator/twitter_handle_cleanup/utils.py and 1 other location - About 2 hrs to fix
              accelerator/twitter_handle_cleanup/utils.py on lines 137..140

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

              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

                  for profile in profile_list:
                      profile = [Model.__name__] + list(profile)
                      profile.append(profile[2][3:])
                      write_to_csv(profile)
              Severity: Major
              Found in accelerator/twitter_handle_cleanup/utils.py and 1 other location - About 2 hrs to fix
              accelerator/twitter_handle_cleanup/utils.py on lines 65..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 53.

              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

              File base_judging_round.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from __future__ import unicode_literals
              
              import swapper
              from django.db.models import (
                  BooleanField,
              Severity: Minor
              Found in accelerator_abstract/models/base_judging_round.py - About 2 hrs to fix

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

                    if match:
                        new_twitter_handle = twitter_handle[1:]
                        profile_list = [
                            obj.__class__.__name__,
                            obj.id,
                Severity: Major
                Found in accelerator/twitter_handle_cleanup/utils.py and 1 other location - About 1 hr to fix
                accelerator/twitter_handle_cleanup/utils.py on lines 40..50

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 49.

                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 twitter_handle.endswith("/"):
                        new_twitter_handle = twitter_handle[:-1]
                        profile_list = [
                            obj.__class__.__name__,
                            obj.id,
                Severity: Major
                Found in accelerator/twitter_handle_cleanup/utils.py and 1 other location - About 1 hr to fix
                accelerator/twitter_handle_cleanup/utils.py on lines 24..34

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

                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

                    additional_industries = models.ManyToManyField(
                        swapper.get_model_name(AcceleratorModel.Meta.app_label, 'Industry'),
                Severity: Major
                Found in accelerator_abstract/models/base_startup.py and 1 other location - About 1 hr to fix
                accelerator_abstract/models/base_partner.py on lines 30..31

                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

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

                    additional_industries = models.ManyToManyField(
                        swapper.get_model_name(AcceleratorModel.Meta.app_label, 'Industry'),
                Severity: Major
                Found in accelerator_abstract/models/base_partner.py and 1 other location - About 1 hr to fix
                accelerator_abstract/models/base_startup.py on lines 66..67

                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

                Severity
                Category
                Status
                Source
                Language