From ca222d7f929dc05d46fa4249262f9c25b6989df3 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Wed, 17 Apr 2019 20:46:45 -0700 Subject: [PATCH] Add McCabe complexity checker --- rest_auth/registration/serializers.py | 2 +- rest_auth/serializers.py | 2 +- setup.cfg | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 4f99c18..d62d701 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -58,7 +58,7 @@ class SocialLoginSerializer(serializers.Serializer): social_login.token = token return social_login - def validate(self, attrs): + def validate(self, attrs): # noqa: C901 view = self.context.get('view') request = self._get_request() diff --git a/rest_auth/serializers.py b/rest_auth/serializers.py index b645231..33bbfde 100644 --- a/rest_auth/serializers.py +++ b/rest_auth/serializers.py @@ -59,7 +59,7 @@ class LoginSerializer(serializers.Serializer): return user - def validate(self, attrs): + def validate(self, attrs): # noqa: C901 username = attrs.get('username') email = attrs.get('email') password = attrs.get('password') diff --git a/setup.cfg b/setup.cfg index 714c8aa..97b1620 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,6 +8,7 @@ license_file = LICENSE [flake8] max_line_length = 120 +max_complexity = 10 exclude = migrations