OCA/l10n-italy

View on GitHub
account_fiscal_year_closing/wizard/wizard_run.py

Summary

Maintainability
F
1 wk
Test Coverage

Function create_closing_move has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    def create_closing_move(self, cr, uid, operation, fyc, context):
        """
        Create a closing move (L&P, NL&P or Closing move).
        """
        pool = self.pool
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py - About 1 day 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

File wizard_run.py has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP - Import operations model 347 engine
#    Copyright (C) 2009 Asr Oss. All Rights Reserved
Severity: Minor
Found in account_fiscal_year_closing/wizard/wizard_run.py - About 4 hrs to fix

    Function create_opening_move has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_opening_move(self, cr, uid, operation, fyc, context):
            """
            Create an opening move (based on the closing one)
            """
            pool = self.pool
    Severity: Minor
    Found in account_fiscal_year_closing/wizard/wizard_run.py - About 3 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 run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self, cr, uid, ids, context=None):
            """
            Creates / removes FYC entries
            """
    
    
    Severity: Minor
    Found in account_fiscal_year_closing/wizard/wizard_run.py - 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 _check_unbalanced_moves has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _check_unbalanced_moves(self, cr, uid, fyc, context):
            """
            Checks for unbalanced moves on the fiscal year that is being closed
            """
            pool = self.pool
    Severity: Minor
    Found in account_fiscal_year_closing/wizard/wizard_run.py - About 55 mins 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

    Avoid deeply nested control flow statements.
    Open

                            if account_map.dest_account_id:
                                dest_accounts_totals[account_map.dest_account_id.id] -= balance
                accounts_done += 1
    Severity: Major
    Found in account_fiscal_year_closing/wizard/wizard_run.py - About 45 mins to fix

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

          def create_closing_move(self, cr, uid, operation, fyc, context):
      Severity: Minor
      Found in account_fiscal_year_closing/wizard/wizard_run.py - About 35 mins to fix

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

            def remove_move(self, cr, uid, operation, fyc, context):
        Severity: Minor
        Found in account_fiscal_year_closing/wizard/wizard_run.py - About 35 mins to fix

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

              def create_opening_move(self, cr, uid, operation, fyc, context):
          Severity: Minor
          Found in account_fiscal_year_closing/wizard/wizard_run.py - About 35 mins to fix

            Function remove_move has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def remove_move(self, cr, uid, operation, fyc, context):
                    """
                    Remove a account move (L&P, NL&P, Closing or Opening move)
                    """
                    pool = self.pool
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.py - About 25 mins 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

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

                    if len(account_move_ids):
                        invalid_period_moves = pool.get('account.move').browse(cr, uid, account_move_ids, context)
                        str_invalid_period_moves = '\n'.join(['id: %s, date: %s, number: %s, ref: %s' % (move.id, move.date, move.name, move.ref) for move in invalid_period_moves])
                        raise osv.except_osv(_('Error'), _('One or more moves with invalid period or date found on the fiscal year: \n%s') % str_invalid_period_moves)
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 5 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 207..210

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

            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

                    if len(account_move_ids):
                        draft_moves = pool.get('account.move').browse(cr, uid, account_move_ids, context)
                        str_draft_moves = '\n'.join(['id: %s, date: %s, number: %s, ref: %s' % (move.id, move.date, move.name, move.ref) for move in draft_moves])
                        raise osv.except_osv(_('Error'), _('One or more draft moves found: \n%s') % str_draft_moves)
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 5 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 175..178

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

            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 period in fyc.closing_fiscalyear_id.period_ids:
                        if period.id != fyc.lp_period_id.id \
                                and period.id != fyc.nlp_period_id.id \
                                and period.id != fyc.c_period_id.id:
                            period_ids.append(period.id)
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 3 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 192..196

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

            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 period in fyc.closing_fiscalyear_id.period_ids:
                        if period.id != fyc.lp_period_id.id \
                                and period.id != fyc.nlp_period_id.id \
                                and period.id != fyc.c_period_id.id:
                            period_ids.append(period.id)
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 3 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 223..227

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

            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

                    if len(move_lines):
                        move_id = pool.get('account.move').create(cr, uid, {
                                        'ref': description,
                                        'date': date,
                                        'period_id': period_id,
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 2 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 448..458

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

            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

                    if len(move_lines):
                        move_id = pool.get('account.move').create(cr, uid, {
                                        'ref': description,
                                        'date': date,
                                        'period_id': period_id,
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 2 hrs to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 540..550

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

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

                        if not (fyc.nlp_journal_id and fyc.nlp_journal_id.id):
                            raise osv.except_osv(_('UserError'), _("The Net L&P journal must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.nlp_period_id and fyc.nlp_period_id.id):
                            raise osv.except_osv(_('UserError'), _("The Net L&P period must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.loss_and_profit_move_id and fyc.loss_and_profit_move_id.id):
                            raise osv.except_osv(_('UserError'), _("The L&P move must exist before creating the closing one"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.lp_journal_id and fyc.lp_journal_id.id):
                            raise osv.except_osv(_('UserError'), _("The L&P journal must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.c_period_id and fyc.c_period_id.id):
                            raise osv.except_osv(_('UserError'), _("The closing period must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.lp_period_id and fyc.lp_period_id.id):
                            raise osv.except_osv(_('UserError'), _("The L&P period must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.o_period_id and fyc.o_period_id.id):
                            raise osv.except_osv(_('UserError'), _("The opening period must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

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

                        if not (fyc.o_journal_id and fyc.o_journal_id.id):
                            raise osv.except_osv(_('UserError'), _("The opening journal must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 375..376
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509

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

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

                        if not (fyc.c_journal_id and fyc.c_journal_id.id):
                            raise osv.except_osv(_('UserError'), _("The closing journal must be defined"))
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 8 other locations - About 55 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 309..310
            account_fiscal_year_closing/wizard/wizard_run.py on lines 311..312
            account_fiscal_year_closing/wizard/wizard_run.py on lines 344..345
            account_fiscal_year_closing/wizard/wizard_run.py on lines 346..347
            account_fiscal_year_closing/wizard/wizard_run.py on lines 354..355
            account_fiscal_year_closing/wizard/wizard_run.py on lines 373..374
            account_fiscal_year_closing/wizard/wizard_run.py on lines 508..509
            account_fiscal_year_closing/wizard/wizard_run.py on lines 510..511

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

            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

                    account_move_ids = pool.get('account.move').search(cr, uid, [
                                            ('period_id', 'in', period_ids),
                                            ('state', '!=', 'draft'),
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 199..201

            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

                    account_move_ids = pool.get('account.move').search(cr, uid, [
                                            ('period_id', 'in', period_ids),
                                            ('date', '<', fyc.closing_fiscalyear_id.date_start),
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 160..162

            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

                    account_move_ids = pool.get('account.move').search(cr, uid, [
                                            ('period_id', 'in', period_ids),
                                            ('state', '=', 'draft'),
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 230..232

            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

                    account_move_ids.extend(pool.get('account.move').search(cr, uid, [
                                            ('period_id', 'in', period_ids),
                                            ('date', '>', fyc.closing_fiscalyear_id.date_stop),
            Severity: Minor
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 1 other location - About 40 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 154..156

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

                    elif operation == 'net_loss_and_profit':
                        move = fyc.net_loss_and_profit_move_id
                        pool.get('account_fiscal_year_closing.fyc').write(cr, uid, fyc.id, { 'net_loss_and_profit_move_id': None })
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 3 other locations - About 30 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 573..575
            account_fiscal_year_closing/wizard/wizard_run.py on lines 579..581
            account_fiscal_year_closing/wizard/wizard_run.py on lines 582..584

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

            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

                    if operation == 'loss_and_profit':
                        move = fyc.loss_and_profit_move_id
                        pool.get('account_fiscal_year_closing.fyc').write(cr, uid, fyc.id, { 'loss_and_profit_move_id': None })
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 3 other locations - About 30 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 576..578
            account_fiscal_year_closing/wizard/wizard_run.py on lines 579..581
            account_fiscal_year_closing/wizard/wizard_run.py on lines 582..584

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

            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

                    elif operation == 'open':
                        move = fyc.opening_move_id
                        pool.get('account_fiscal_year_closing.fyc').write(cr, uid, fyc.id, { 'opening_move_id': None })
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 3 other locations - About 30 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 573..575
            account_fiscal_year_closing/wizard/wizard_run.py on lines 576..578
            account_fiscal_year_closing/wizard/wizard_run.py on lines 579..581

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

            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

                    elif operation == 'close':
                        move = fyc.closing_move_id
                        pool.get('account_fiscal_year_closing.fyc').write(cr, uid, fyc.id, { 'closing_move_id': None })
            Severity: Major
            Found in account_fiscal_year_closing/wizard/wizard_run.py and 3 other locations - About 30 mins to fix
            account_fiscal_year_closing/wizard/wizard_run.py on lines 573..575
            account_fiscal_year_closing/wizard/wizard_run.py on lines 576..578
            account_fiscal_year_closing/wizard/wizard_run.py on lines 582..584

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

            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

            There are no issues that match your filters.

            Category
            Status