Net-ng/kansha

View on GitHub

Showing 327 of 327 total issues

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

        with h.div(class_='panel-section'):
            h << h.div(_(u'Comments'), class_='panel-section-title')
            h << h.p(_('Commenting allows members to make short messages on cards. You can enable or disable this feature.'))
            with h.form:
                with h.div(class_='btn-group'):
Severity: Major
Found in kansha/board/view.py and 1 other location - About 2 days to fix
kansha/board/view.py on lines 537..552

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

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

        with h.div(class_='panel-section'):
            h << h.div(_(u'Votes'), class_='panel-section-title')
            h << h.p(_(u'Allow votes'))
            with h.form:
                with h.div(class_='btn-group'):
Severity: Major
Found in kansha/board/view.py and 1 other location - About 2 days to fix
kansha/board/view.py on lines 520..535

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

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

@presentation.render_for(BoardBackground, model='title-color-overlay')
def render_board_background_title_color_overlay(self, h, comp, *args):
    """Color chooser contained in the overlay body"""
    v = var.Var(self.board.title_color)
    i = h.generate_id()
Severity: Major
Found in kansha/board/view.py and 1 other location - About 2 days to fix
kansha/card_addons/label/view.py on lines 51..64

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

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

@presentation.render_for(Label, model='edit-color-overlay')
def render_Label_edit_color_overlay(self, h, comp, *args):
    """Color chooser contained in the overlay body"""
    v = var.Var(self.data.color)
    i = h.generate_id()
Severity: Major
Found in kansha/card_addons/label/view.py and 1 other location - About 2 days to fix
kansha/board/view.py on lines 707..720

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

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

# -*- coding:utf-8 -*-
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
Severity: Major
Found in kansha/authentication/database/forms.py - About 2 days to fix

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

    @presentation.render_for(Header)
    def render_Header(self, h, comp, *args):
        """Head renderer"""
    
        h.head << h.head.title(self.app_banner)
    Severity: Major
    Found in kansha/authentication/database/forms.py and 1 other location - About 1 day to fix
    kansha/authentication/login.py on lines 26..45

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

    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

    @presentation.render_for(Header)
    def render_Header(self, h, comp, *args):
        """Head renderer"""
    
        h.head << h.head.title(self.banner)
    Severity: Major
    Found in kansha/authentication/login.py and 1 other location - About 1 day to fix
    kansha/authentication/database/forms.py on lines 38..57

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

    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

    class CreateDemo(command.Command):
    
        desc = 'Create demo users and contents.'
    
        @staticmethod
    Severity: Major
    Found in kansha/batch/create_demo.py and 1 other location - About 1 day to fix
    kansha/batch/create_index.py on lines 51..83

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

    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

    class ReIndex(command.Command):
    
        desc = '(Re-)Create index for the application.'
    
        @staticmethod
    Severity: Major
    Found in kansha/batch/create_index.py and 1 other location - About 1 day to fix
    kansha/batch/create_demo.py on lines 51..83

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

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

    # -*- coding:utf-8 -*-
    # --
    # Copyright (c) 2012-2014 Net-ng.
    # All rights reserved.
    #
    Severity: Major
    Found in kansha/board/comp.py - About 1 day to fix

      File view.py has 661 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding:utf-8 -*-
      # --
      # Copyright (c) 2012-2014 Net-ng.
      # All rights reserved.
      #
      Severity: Major
      Found in kansha/board/view.py - About 1 day to fix

        Board has 78 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Board(events.EventHandlerMixIn):
        
            """Board component"""
        
            MAX_SHOWN_MEMBERS = 4
        Severity: Major
        Found in kansha/board/comp.py - About 1 day to fix

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

                      with h.div(class_='fields'):
                          fields = (
                              (_('Username'), 'username', 'text', self.username),
                              (_('Email address'), 'email', 'text', self.email),
                          )
          Severity: Major
          Found in kansha/authentication/database/forms.py and 1 other location - About 1 day to fix
          kansha/authentication/database/forms.py on lines 319..331

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

          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

                      with h.div(class_='fields'):
                          fields = (
                              (_('Email address'), 'email', 'text', self.email),
                              (_('Email address (repeat)'), 'email', 'text', self.email_repeat),
                          )
          Severity: Major
          Found in kansha/authentication/database/forms.py and 1 other location - About 1 day to fix
          kansha/authentication/database/forms.py on lines 561..573

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

          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

          @presentation.render_for(PasswordResetConfirmation, model='send_email_failed')
          def render_registration_confirmation_mail_error(self, h, comp, *args):
              h << self.header.render(h, 'hide')
              with h.div(class_='regForm'):
                  with h.h3:
          Severity: Major
          Found in kansha/authentication/database/forms.py and 1 other location - About 1 day to fix
          kansha/authentication/database/forms.py on lines 834..850

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

          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

          @presentation.render_for(EmailConfirmation, 'send_email_failed')
          def render_registration_confirmation_error(self, h, comp, *args):
              h << self.header.render(h, 'hide')
              with h.div(class_='regForm'):
                  with h.h3:
          Severity: Major
          Found in kansha/authentication/database/forms.py and 1 other location - About 1 day to fix
          kansha/authentication/database/forms.py on lines 677..693

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

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

                  initCard: function (card) {
                      var drag = new ScrollProxy(card, 'card', {
                          dragElId: 'dnd-frame',
                          scrollParent: 'lists'
                      });
          Severity: Major
          Found in static/js/dnd.js - About 7 hrs to fix

            File oauth_providers.py has 422 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding:utf-8 -*-
            #--
            # Copyright (c) 2012-2014 Net-ng.
            # All rights reserved.
            #
            Severity: Minor
            Found in kansha/authentication/oauth/oauth_providers.py - About 6 hrs to fix

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

              @presentation.render_for(Label, model='edit-color')
              def render_Label_edit_color(self, h, comp, *args):
                  """Edit the label color"""
                  # If label changed reload columns
                  h << component.Component(overlay.Overlay(lambda r: comp.render(r, model='color'),
              Severity: Major
              Found in kansha/card_addons/label/view.py and 1 other location - About 5 hrs to fix
              kansha/board/view.py on lines 688..697

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

              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

              @presentation.render_for(BoardBackground, model='title-color-edit')
              def render_board_background_title_color_edit(self, h, comp, *args):
                  """Edit the label color"""
                  # If label changed reload columns
                  h << component.Component(overlay.Overlay(lambda r: comp.render(r, model='title-color'),
              Severity: Major
              Found in kansha/board/view.py and 1 other location - About 5 hrs to fix
              kansha/card_addons/label/view.py on lines 38..48

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

              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