intranet/apps/polls/tests.py

Summary

Maintainability
F
5 days
Test Coverage

File tests.py has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import datetime
import json

from django.urls import reverse
from django.utils import timezone
Severity: Minor
Found in intranet/apps/polls/tests.py - About 4 hrs to fix

    Function test_multi_select_voting has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def test_multi_select_voting(self):
            self.make_admin()
    
            question_data = json.dumps(
                [
    Severity: Major
    Found in intranet/apps/polls/tests.py - About 2 hrs to fix

      Function test_can_vote has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def test_can_vote(self):
              user = self.login()
              user.is_superuser = False
              user.groups.clear()
      
      
      Severity: Minor
      Found in intranet/apps/polls/tests.py - About 1 hr to fix

        Function test_single_select_voting has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def test_single_select_voting(self):
                self.make_admin()
        
                question_data = json.dumps(
                    [
        Severity: Minor
        Found in intranet/apps/polls/tests.py - About 1 hr to fix

          Function test_free_response_voting has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def test_free_response_voting(self):
                  self.make_admin()
          
                  question_data = json.dumps(
                      [
          Severity: Minor
          Found in intranet/apps/polls/tests.py - About 1 hr to fix

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

                    response = self.client.post(
                        reverse("add_poll"),
                        data={
                            "title": "Free Response Poll",
                            "description": "This is a test poll!",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 3 other locations - About 4 hrs to fix
            intranet/apps/polls/tests.py on lines 30..38
            intranet/apps/polls/tests.py on lines 222..230
            intranet/apps/polls/tests.py on lines 301..309

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

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

                    response = self.client.post(
                        reverse("add_poll"),
                        data={
                            "title": "Multi Select Poll",
                            "description": "This is a test poll!",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 3 other locations - About 4 hrs to fix
            intranet/apps/polls/tests.py on lines 30..38
            intranet/apps/polls/tests.py on lines 222..230
            intranet/apps/polls/tests.py on lines 405..413

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

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

                    response = self.client.post(
                        reverse("add_poll"),
                        data={
                            "title": "Test Poll",
                            "description": "This is a test poll!",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 3 other locations - About 4 hrs to fix
            intranet/apps/polls/tests.py on lines 222..230
            intranet/apps/polls/tests.py on lines 301..309
            intranet/apps/polls/tests.py on lines 405..413

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

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

                    response = self.client.post(
                        reverse("add_poll"),
                        data={
                            "title": "Single Select Poll",
                            "description": "This is a test poll!",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 3 other locations - About 4 hrs to fix
            intranet/apps/polls/tests.py on lines 30..38
            intranet/apps/polls/tests.py on lines 301..309
            intranet/apps/polls/tests.py on lines 405..413

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

            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

                    question_data = json.dumps(
                        [
                            {
                                "question": "What is your favorite color?",
                                "type": "APP",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 2 other locations - About 1 hr to fix
            intranet/apps/polls/tests.py on lines 19..25
            intranet/apps/polls/tests.py on lines 211..217

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

            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

                    question_data = json.dumps(
                        [
                            {
                                "question": "What is your favorite color?",
                                "type": "STD",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 2 other locations - About 1 hr to fix
            intranet/apps/polls/tests.py on lines 211..217
            intranet/apps/polls/tests.py on lines 290..296

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

            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

                    question_data = json.dumps(
                        [
                            {
                                "question": "What is your favorite color?",
                                "type": "STD",
            Severity: Major
            Found in intranet/apps/polls/tests.py and 2 other locations - About 1 hr to fix
            intranet/apps/polls/tests.py on lines 19..25
            intranet/apps/polls/tests.py on lines 290..296

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

            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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": ["1", "3"]},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 1 other location - About 1 hr to fix
            intranet/apps/polls/tests.py on lines 322..324

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

            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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": ["1", "3"]},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 1 other location - About 1 hr to fix
            intranet/apps/polls/tests.py on lines 337..339

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

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "different test content"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439

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

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "CLEAR"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "1"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "1"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "CLEAR"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "3"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "test content"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 437..439
            intranet/apps/polls/tests.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 35.

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

                    response = self.client.post(
                        reverse("poll_vote", kwargs={"poll_id": poll.id}),
                        data={"question-1": "test content"},
            Severity: Major
            Found in intranet/apps/polls/tests.py and 11 other locations - About 45 mins to fix
            intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 310..310
            intranet/apps/eighth/tests/test_attendance.py on lines 503..503
            intranet/apps/eighth/tests/test_attendance.py on lines 511..511
            intranet/apps/announcements/tests.py on lines 473..473
            intranet/apps/polls/tests.py on lines 243..245
            intranet/apps/polls/tests.py on lines 255..257
            intranet/apps/polls/tests.py on lines 266..268
            intranet/apps/polls/tests.py on lines 276..278
            intranet/apps/polls/tests.py on lines 370..372
            intranet/apps/polls/tests.py on lines 426..428
            intranet/apps/polls/tests.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 35.

            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

            Line too long (102 > 79 characters)
            Open

                    # Vote for "Red", "Blue" and "Green" which should exceed max_choices and nothing should change
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (148 > 79 characters)
            Open

                        "You have voted on too many options for Question #1: 'What is your favorite color?'", list(map(str, list(response.context["messages"])))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (126 > 79 characters)
            Open

                    self.assertEqual(poll.get_voted_string(), "{} out of {} ({}) eligible users voted in this poll.".format(0, 1, "0.0%"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (104 > 79 characters)
            Open

                            "end_time": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (106 > 79 characters)
            Open

                            "start_time": (timezone.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (129 > 79 characters)
            Open

                    self.assertEqual(poll[0].get_voted_string(), "{} out of {} ({}) eligible users voted in this poll.".format(0, 1, "0.0%"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (117 > 79 characters)
            Open

                    poll = Poll.objects.create(title="Test", description="Test", start_time=ago_5, end_time=ago_5, visible=False)
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (105 > 79 characters)
            Open

                    response = self.client.get(reverse("poll_csv_results", kwargs={"poll_id": poll.id}), follow=True)
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (106 > 79 characters)
            Open

                            "start_time": (timezone.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (106 > 79 characters)
            Open

                            "start_time": (timezone.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (118 > 79 characters)
            Open

                    response = self.client.post(reverse("poll_vote", kwargs={"poll_id": poll.first().id}), data={"question-1": 3})
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (131 > 79 characters)
            Open

                    self.assertEqual(poll[0].get_voted_string(), "{} out of {} ({}) eligible users voted in this poll.".format(1, 1, "100.0%"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (145 > 79 characters)
            Open

                        title="Test Poll 3", description="hello", start_time=timezone.localtime(), end_time=timezone.localtime() + timezone.timedelta(days=1)
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (104 > 79 characters)
            Open

                            "end_time": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (103 > 79 characters)
            Open

                    user_choice = Answer.objects.get(question=Question.objects.get(poll=poll[0]), user=user).choice
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (105 > 79 characters)
            Open

                    response = self.client.get(reverse("poll_csv_results", kwargs={"poll_id": poll.id}), follow=True)
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (126 > 79 characters)
            Open

                    self.assertIn("CSV results cannot be generated for secret polls.", list(map(str, list(response.context["messages"]))))
            Severity: Minor
            Found in intranet/apps/polls/tests.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

                    self.assertEqual(user_choice, Choice.objects.get(question__poll=poll[0], info="Blue"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (86 > 79 characters)
            Open

                                "choices": [{"info": "Red"}, {"info": "Green"}, {"info": "Blue"}],
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (104 > 79 characters)
            Open

                            "end_time": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (126 > 79 characters)
            Open

                    self.assertEqual(poll.get_voted_string(), "{} out of {} ({}) eligible users voted in this poll.".format(0, 0, "0.0%"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (126 > 79 characters)
            Open

                    self.assertEqual(poll.get_voted_string(), "{} out of {} ({}) eligible users voted in this poll.".format(0, 1, "0.0%"))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (86 > 79 characters)
            Open

                                "choices": [{"info": "Red"}, {"info": "Green"}, {"info": "Blue"}],
            Severity: Minor
            Found in intranet/apps/polls/tests.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

                    response = self.client.get(reverse("poll_csv_results", kwargs={"poll_id": poll.id}))
            Severity: Minor
            Found in intranet/apps/polls/tests.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

                    response = self.client.post(reverse("delete_poll", kwargs={"poll_id": poll.first().id}))
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (104 > 79 characters)
            Open

                            "end_time": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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

                    self.assertEqual(Choice.objects.filter(question__poll=poll[0]).count(), 3)
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (106 > 79 characters)
            Open

                            "start_time": (timezone.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
            Severity: Minor
            Found in intranet/apps/polls/tests.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 (86 > 79 characters)
            Open

                                "choices": [{"info": "Red"}, {"info": "Green"}, {"info": "Blue"}],
            Severity: Minor
            Found in intranet/apps/polls/tests.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.

            There are no issues that match your filters.

            Category
            Status