Princeton-CDH/derrida-django

View on GitHub

Showing 184 of 184 total issues

Function imgAreaSelect has 506 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.imgAreaSelect = function (img, options) {
    var

        $img = $(img),

Severity: Major
Found in sitemedia/js/annotator/imgAreaSelect.js - About 2 days to fix

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

            for range_facet in self.form.range_facets:
                start = end = None
                # range filter requested in search options
                if range_facet in search_opts and search_opts[range_facet]:
                    start, end = search_opts[range_facet].split('-')
    Severity: Major
    Found in derrida/interventions/views.py and 2 other locations - About 2 days to fix
    derrida/books/views.py on lines 247..269
    derrida/books/views.py on lines 399..421

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

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

            for range_facet in self.form.range_facets:
                start = end = None
                # range filter requested in search options
                if range_facet in search_opts and search_opts[range_facet]:
                    start, end = search_opts[range_facet].split('-')
    Severity: Major
    Found in derrida/books/views.py and 2 other locations - About 2 days to fix
    derrida/interventions/views.py on lines 257..279
    derrida/books/views.py on lines 399..421

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

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

            for range_facet in self.form.range_facets:
                start = end = None
                # range filter requested in search options
                if range_facet in search_opts and search_opts[range_facet]:
                    start, end = search_opts[range_facet].split('-')
    Severity: Major
    Found in derrida/books/views.py and 2 other locations - About 2 days to fix
    derrida/interventions/views.py on lines 257..279
    derrida/books/views.py on lines 247..269

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

    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 site.js has 780 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    $(function() {
    
      // Clear the text inputs initially so that they are set properly
      // based on the checked boxes when users hit back/forward in the browser
      $('.mdl-textfield__input:not([name=query])').val(''); // but don't clear the header search bar...let it persist
    Severity: Major
    Found in sitemedia/js/site.js - About 1 day to fix

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

      # -*- coding: utf-8 -*-
      import codecs
      import csv
      import datetime
      from io import StringIO
      Severity: Major
      Found in derrida/interventions/tests.py - About 1 day to fix

        File models.py has 664 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import json
        import string
        
        from django.contrib.contenttypes.fields import GenericRelation
        from django.core.exceptions import ValidationError
        Severity: Major
        Found in derrida/books/models.py - About 1 day to fix

          Function initGlobalFunctions has 285 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function initGlobalFunctions() {
              window.initYearSelector = function(options) {
                var selector = options.selector,
                    fieldName = options.fieldName;
          
          
          Severity: Major
          Found in sitemedia/js/site.js - About 1 day to fix

            File views.py has 555 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import datetime
            import json
            import logging
            
            from dal import autocomplete
            Severity: Major
            Found in derrida/books/views.py - About 1 day to fix

              File imgAreaSelect.js has 538 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * imgAreaSelect jQuery plugin
               * version 0.9.10
               *
               * Copyright (c) 2008-2013 Michal Wojciechowski (odyniec.net)
              Severity: Major
              Found in sitemedia/js/annotator/imgAreaSelect.js - About 1 day to fix

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

                        for facet_field in self.form.facet_fields:
                            form_field = facet_field
                            if facet_field in self.form.solr_facet_fields:
                                form_field = self.form.solr_facet_fields[facet_field]
                            field_values = form_opts.getlist(form_field, None)
                Severity: Major
                Found in derrida/interventions/views.py and 1 other location - About 1 day to fix
                derrida/books/views.py on lines 326..349

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

                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

                        for facet_field in self.form.facet_fields:
                            form_field = facet_field
                            if facet_field in self.form.solr_facet_fields:
                                form_field = self.form.solr_facet_fields[facet_field]
                            field_values = form_opts.getlist(form_field, None)
                Severity: Major
                Found in derrida/books/views.py and 1 other location - About 1 day to fix
                derrida/interventions/views.py on lines 197..219

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

                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

                        migrations.CreateModel(
                            name='PersonBook',
                            fields=[
                                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                                ('notes', models.TextField(blank=True)),
                derrida/people/migrations/0001_initial.py on lines 61..69

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

                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

                        migrations.CreateModel(
                            name='Residence',
                            fields=[
                                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                                ('notes', models.TextField(blank=True)),
                Severity: Major
                Found in derrida/people/migrations/0001_initial.py and 1 other location - About 7 hrs to fix
                derrida/books/migrations/0001_squashed_0033_remove_book_models.py on lines 183..191

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

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

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

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

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

                Refactorings

                Further Reading

                Function annotatorImageSelect has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function annotatorImageSelect(options) {
                  var _t = annotator.util.gettext,
                    global = this;  // equivalent to previously used annotator.util.getGlobal()
                
                  options = options || {};
                Severity: Major
                Found in sitemedia/js/annotator/imgselect.js - About 6 hrs to fix

                  Function annotatorInterventions has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function annotatorInterventions(confs) {
                  
                    var interventions = {
                  
                      /**
                  Severity: Major
                  Found in sitemedia/js/annotator/interventions-plugin.js - About 6 hrs to fix

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

                        def solr_field(self, field):
                            '''Return corresponding solr field for search facet or order
                            input for this form.'''
                            # sort fields
                            if field in self.sort_fields:
                    Severity: Major
                    Found in derrida/interventions/forms.py and 1 other location - About 5 hrs to fix
                    derrida/books/forms.py on lines 231..247

                    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

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

                        def solr_field(self, field):
                            '''Return corresponding solr field for search facet or order
                            input for this form.'''
                            # sort fields
                            if field in self.sort_fields:
                    Severity: Major
                    Found in derrida/books/forms.py and 1 other location - About 5 hrs to fix
                    derrida/interventions/forms.py on lines 75..91

                    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

                    Function initYearSelector has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        window.initYearSelector = function(options) {
                          var selector = options.selector,
                              fieldName = options.fieldName;
                    
                          var $yearFilter = $(selector),
                    Severity: Major
                    Found in sitemedia/js/site.js - About 5 hrs to fix

                      Function initAuthorFilter has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function initAuthorFilter() {
                          var $authorFilter = $(".filter.filter--author");
                          if (! $authorFilter.length) {
                            return false;
                          }
                      Severity: Major
                      Found in sitemedia/js/site.js - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language