dirtycoder/pets

View on GitHub

Showing 82 of 82 total issues

Function matchMedia has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.matchMedia || (window.matchMedia = function() {
    "use strict";

    // For browsers that support matchMedium api such as IE 9 and webkit
    var styleMedia = (window.styleMedia || window.media);
Severity: Minor
Found in pets/static/js/matchMedia.js - About 1 hr to fix

    Function add_facebook_link has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def add_facebook_link(strategy, details, user=None, backend=None, is_new=None, *args, **kwargs):
    Severity: Major
    Found in pets/users/pipeline.py - About 50 mins to fix

      Function matchMedia has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      window.matchMedia || (window.matchMedia = function() {
          "use strict";
      
          // For browsers that support matchMedium api such as IE 9 and webkit
          var styleMedia = (window.styleMedia || window.media);
      Severity: Minor
      Found in pets/static/js/matchMedia.js - About 35 mins 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

      Line too long (90 > 79 characters)
      Open

                  raise forms.ValidationError(_("Image is larger than the maximum size of 8MB"))
      Severity: Minor
      Found in pets/meupet/forms.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (93 > 79 characters)
      Open

                  "loaders": [("django.template.loaders.cached.Loader", PROJECT_TEMPLATE_LOADERS)],
      Severity: Minor
      Found in pets/pets/settings/prod.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (92 > 79 characters)
      Open

      FACEBOOK_SHARE_GRAPH_API_VERSION = config("FACEBOOK_SHARE_GRAPH_API_VERSION", default="3.1")
      Severity: Minor
      Found in pets/pets/settings/prod.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (83 > 79 characters)
      Open

                  return self.actives().filter(kind__id=int(kind)).select_related("city")
      Severity: Minor
      Found in pets/meupet/models.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (98 > 79 characters)
      Open

              queryset = models.PetStatus.objects.values_list("id", "description").filter(status_filter)
      Severity: Minor
      Found in pets/meupet/forms.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (85 > 79 characters)
      Open

                  return HttpResponseRedirect(resolve_url(self.authenticated_redirect_url))
      Severity: Minor
      Found in pets/users/views.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (96 > 79 characters)
      Open

      def add_facebook_link(strategy, details, user=None, backend=None, is_new=None, *args, **kwargs):
      Severity: Minor
      Found in pets/users/pipeline.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (102 > 79 characters)
      Open

          url(r"^recover/reset/done/$", views.RecoverResetDoneView.as_view(), name="recover_password_done"),
      Severity: Minor
      Found in pets/users/urls.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (80 > 79 characters)
      Open

          context = {"username": pet.owner.first_name, "site_name": current_site.name}
      Severity: Minor
      Found in pets/meupet/services.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (89 > 79 characters)
      Open

          url(r"^new/$", RedirectView.as_view(pattern_name="meupet:register", permanent=True)),
      Severity: Minor
      Found in pets/meupet/urls.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (80 > 79 characters)
      Open

          url(r"^(?P<slug>[-\w]*)/registrado/$", views.registered, name="registered"),
      Severity: Minor
      Found in pets/meupet/urls.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (91 > 79 characters)
      Open

          url(r"^(?P<slug>[-\w]*)/editar/situacao/$", views.change_status, name="change_status"),
      Severity: Minor
      Found in pets/meupet/urls.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (85 > 79 characters)
      Open

          return os.path.join(settings.CITIES_DATA_LOCATION, country.lower(), "states.csv")
      Severity: Minor
      Found in pets/cities/utils.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (82 > 79 characters)
      Open

                  code=state.get("code"), abbr=state.get("abbr"), name=state.get("name")
      Severity: Minor
      Found in pets/cities/utils.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (94 > 79 characters)
      Open

          url(r"^profile/(?P<pk>[0-9]+)/$", views.ProfileDetailView.as_view(), name="user_profile"),
      Severity: Minor
      Found in pets/users/urls.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (96 > 79 characters)
      Open

          list_display = ("fb_share_app_id", "fb_share_app_secret", "fb_share_link", "fb_share_token")
      Severity: Minor
      Found in pets/common/admin.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Line too long (94 > 79 characters)
      Open

              stale_date = timezone.now() - timezone.timedelta(days=settings.DAYS_TO_STALE_REGISTER)
      Severity: Minor
      Found in pets/meupet/models.py by pep8

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.
      Severity
      Category
      Status
      Source
      Language