wbrefvem/corkboard

View on GitHub

Showing 212 of 212 total issues

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

        migrations.CreateModel(
            name='ParticipantType',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('text', models.TextField()),
Severity: Major
Found in cascade/migrations/0001_initial.py and 4 other locations - About 2 hrs to fix
cascade/migrations/0001_initial.py on lines 31..39
cascade/migrations/0001_initial.py on lines 41..49
cascade/migrations/0001_initial.py on lines 85..93
cascade/migrations/0001_initial.py on lines 118..126

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

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

        migrations.CreateModel(
            name='Route',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('text', models.TextField()),
Severity: Major
Found in cascade/migrations/0001_initial.py and 4 other locations - About 2 hrs to fix
cascade/migrations/0001_initial.py on lines 31..39
cascade/migrations/0001_initial.py on lines 41..49
cascade/migrations/0001_initial.py on lines 85..93
cascade/migrations/0001_initial.py on lines 108..116

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

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

        migrations.CreateModel(
            name='Area',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.TextField()),
Severity: Major
Found in cascade/migrations/0001_initial.py and 4 other locations - About 2 hrs to fix
cascade/migrations/0001_initial.py on lines 31..39
cascade/migrations/0001_initial.py on lines 85..93
cascade/migrations/0001_initial.py on lines 108..116
cascade/migrations/0001_initial.py on lines 118..126

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

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

        migrations.CreateModel(
            name='EventType',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('text', models.TextField()),
Severity: Major
Found in cascade/migrations/0001_initial.py and 4 other locations - About 2 hrs to fix
cascade/migrations/0001_initial.py on lines 31..39
cascade/migrations/0001_initial.py on lines 41..49
cascade/migrations/0001_initial.py on lines 108..116
cascade/migrations/0001_initial.py on lines 118..126

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

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

        migrations.CreateModel(
            name='AltDate',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('date', models.DateTimeField()),
Severity: Major
Found in cascade/migrations/0001_initial.py and 4 other locations - About 2 hrs to fix
cascade/migrations/0001_initial.py on lines 41..49
cascade/migrations/0001_initial.py on lines 85..93
cascade/migrations/0001_initial.py on lines 108..116
cascade/migrations/0001_initial.py on lines 118..126

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

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 tabularFormset has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.fn.tabularFormset = function(options) {
    var $rows = $(this);
    var alternatingRows = function(row) {
      $($rows.selector).not(".add-row").removeClass("row1 row2")
        .filter(":even").addClass("row1").end()
Severity: Major
Found in static/admin/js/inlines.js - About 2 hrs to fix

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

    var AZERBAIJANI_MAP = {
        'ç':'c', 'ə':'e', 'ğ':'g', 'ı':'i', 'ö':'o', 'ş':'s', 'ü':'u',
        'Ç':'C', 'Ə':'E', 'Ğ':'G', 'İ':'I', 'Ö':'O', 'Ş':'S', 'Ü':'U'
    };
    Severity: Major
    Found in static/admin/js/urlify.js and 1 other location - About 2 hrs to fix
    static/admin/js/urlify.js on lines 73..76

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

    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

    var SERBIAN_MAP = {
        'ђ':'dj', 'ј':'j', 'љ':'lj', 'њ':'nj', 'ћ':'c', 'џ':'dz', 'đ':'dj',
        'Ђ':'Dj', 'Ј':'j', 'Љ':'Lj', 'Њ':'Nj', 'Ћ':'C', 'Џ':'Dz', 'Đ':'Dj'
    };
    Severity: Major
    Found in static/admin/js/urlify.js and 1 other location - About 2 hrs to fix
    static/admin/js/urlify.js on lines 77..80

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

    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 forms.py has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from django import forms
    from cascade import models
    from django.conf import settings
    
    FIELDS = [
    Severity: Minor
    Found in cascade/forms.py - About 2 hrs to fix

      Function draw has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999
              var today = new Date();
              var todayDay = today.getDate();
              var todayMonth = today.getMonth()+1;
              var todayYear = today.getFullYear();
      Severity: Minor
      Found in static/admin/js/calendar.js - About 2 hrs 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

      Function internalData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function internalData( elem, name, data, pvt /* Internal Use Only */ ){
          if ( !jQuery.acceptData( elem ) ) {
              return;
          }
      
      
      Severity: Major
      Found in static/admin/js/jquery.js - About 2 hrs to fix

        Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            remove: function( elem, types, handler, selector, mappedTypes ) {
                var j, handleObj, tmp,
                    origCount, t, events,
                    special, handlers, type,
                    namespaces, origType,
        Severity: Major
        Found in static/admin/js/jquery.js - About 2 hrs to fix

          Function ajaxConvert has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ajaxConvert( s, response ) {
              var conv2, current, conv, tmp,
                  converters = {},
                  i = 0,
                  // Work with a copy of dataTypes in case we need to modify it for conversion
          Severity: Major
          Found in static/admin/js/jquery.js - About 2 hrs to fix

            Function draw has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999
                    var today = new Date();
                    var todayDay = today.getDate();
                    var todayMonth = today.getMonth()+1;
                    var todayYear = today.getFullYear();
            Severity: Minor
            Found in static/admin/js/calendar.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                              if ( ( mappedTypes || origType === handleObj.origType ) &&
                                  ( !handler || handler.guid === handleObj.guid ) &&
                                  ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                  ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                                  handlers.splice( j, 1 );
              Severity: Critical
              Found in static/admin/js/jquery.js - About 2 hrs to fix

                Function addCalendar has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    addCalendar: function(inp) {
                        var num = DateTimeShortcuts.calendars.length;
                
                        DateTimeShortcuts.calendarInputs[num] = inp;
                        DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; };
                Severity: Minor
                Found in static/admin/js/admin/DateTimeShortcuts.js - About 1 hr to fix

                  Function internalRemoveData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function internalRemoveData( elem, name, pvt ) {
                      if ( !jQuery.acceptData( elem ) ) {
                          return;
                      }
                  
                  
                  Severity: Minor
                  Found in static/admin/js/jquery.js - About 1 hr to fix

                    Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function tokenize( selector, parseOnly ) {
                        var matched, match, tokens, type,
                            soFar, groups, preFilters,
                            cached = tokenCache[ selector + " " ];
                    
                    
                    Severity: Minor
                    Found in static/admin/js/jquery.js - About 1 hr to fix

                      Function select has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function select( selector, context, results, seed ) {
                          var i, tokens, token, type, find,
                              match = tokenize( selector );
                      
                          if ( !seed ) {
                      Severity: Minor
                      Found in static/admin/js/jquery.js - About 1 hr to fix

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

                                        event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
                        Severity: Major
                        Found in static/admin/js/jquery.js and 1 other location - About 1 hr to fix
                        static/admin/js/jquery.js on lines 3218..3218

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

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

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

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

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

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language