Net-ng/kansha

View on GitHub

Showing 327 of 327 total issues

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

    def update_document(self, document):
        document.labels = u' '.join(label.get_title() for label in self.labels)
Severity: Minor
Found in kansha/card_addons/label/comp.py and 1 other location - About 40 mins to fix
kansha/card_addons/checklist/comp.py on lines 221..222

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

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

    def update_document(self, document):
        document.checklists = u'\n'.join(cl.to_indexable() for cl in self.data)
Severity: Minor
Found in kansha/card_addons/checklist/comp.py and 1 other location - About 40 mins to fix
kansha/card_addons/label/comp.py on lines 114..115

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

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 write_extension_data_CardDescription has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def write_extension_data_CardDescription(self, sheet, row, col, style):
Severity: Minor
Found in kansha/card_addons/description/comp.py - About 35 mins to fix

    Function render_asset has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def render_asset(self, h, comp, model, *args):
    Severity: Minor
    Found in kansha/card_addons/gallery/view.py - About 35 mins to fix

      Function write_extension_data_CardWeightEditor has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def write_extension_data_CardWeightEditor(self, sheet, row, col, style):
      Severity: Minor
      Found in kansha/card_addons/weight/comp.py - About 35 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, field_id, completion_func, delimiter=None,
        Severity: Minor
        Found in kansha/toolbox/autocomplete.py - About 35 mins to fix

          Function write_extension_data_Comments has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def write_extension_data_Comments(self, sheet, row, col, style):
          Severity: Minor
          Found in kansha/card_addons/comment/comp.py - About 35 mins to fix

            Function write_extension_data_CardDescription has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def write_extension_data_CardDescription(self, sheet, row, col, style):
            Severity: Minor
            Found in kansha/card_addons/label/comp.py - About 35 mins to fix

              Function render_asset_anonymous has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def render_asset_anonymous(self, h, comp, model, *args):
              Severity: Minor
              Found in kansha/card_addons/gallery/view.py - About 35 mins to fix

                Function init_app__new_mail has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def init_app__new_mail(self, url, comp, http_method, request):
                Severity: Minor
                Found in kansha/app/urls.py - About 35 mins to fix

                  Function add_history has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def add_history(cls, board, card, user, action, data):
                  Severity: Minor
                  Found in kansha/services/actionlog/models.py - About 35 mins to fix

                    Function create_cover has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def create_cover(self, file_id, left, top, width, height):
                    Severity: Minor
                    Found in kansha/services/simpleassetsmanager/simpleassetsmanager.py - About 35 mins to fix

                      Function make_cover has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def make_cover(self, asset, left, top, width, height):
                      Severity: Minor
                      Found in kansha/card_addons/gallery/comp.py - About 35 mins to fix

                        Function init_app__reset has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def init_app__reset(self, url, comp, http_method, request):
                        Severity: Minor
                        Found in kansha/app/urls.py - About 35 mins to fix

                          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, app_title, app_banner, theme, get_user, confirmation_base_url):
                          Severity: Minor
                          Found in kansha/authentication/database/forms.py - About 35 mins to fix

                            Function write_extension_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def write_extension_data(card_extension, worksheet, row, col, style):
                            Severity: Minor
                            Found in kansha/board/excel_export.py - About 35 mins to fix

                              Function init_app__board has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def init_app__board(self, url, comp, http_method, request):
                              Severity: Minor
                              Found in kansha/app/urls.py - About 35 mins to fix

                                Function init_app__assets has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def init_app__assets(self, url, comp, http_method, request):
                                Severity: Minor
                                Found in kansha/app/urls.py - About 35 mins to fix

                                  Function define_field has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def define_field(self, schema_name, field_type, name, indexed, stored):
                                  Severity: Minor
                                  Found in kansha/services/search/sqliteengine.py - About 35 mins to fix

                                    Function render_Asset_thumb has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def render_Asset_thumb(self, h, comp, model, *args):
                                    Severity: Minor
                                    Found in kansha/card_addons/gallery/view.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language