setokinto/slack-shogi

View on GitHub

Showing 76 of 76 total issues

Consider simplifying this complex logical expression.
Open

                    if (turn and t[0] > to_x and t[1] < to_y) or \
                       (not turn and t[0] < to_x and t[1] > to_y):
                        from_x, from_y = t
                        from_flag = 0
                        break
Severity: Major
Found in app/modules/parse_input.py - About 40 mins to fix

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

    @respond_to(".*ひふみん[eye, アイ, あい]?")
    @respond_to(".*反転.*")
    @channel_info
    @should_exist_shogi
    def hifumin(channel, message):
    Severity: Minor
    Found in app/shogi.py and 1 other location - About 40 mins to fix
    app/shogi.py on lines 88..97

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

        def movable(self, from_x, from_y, to_x, to_y, promote):
    Severity: Minor
    Found in app/modules/shogi_input.py - About 35 mins to fix

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

      def input_emojis(id_, password, team_id, two_factor, force_update=False):
      Severity: Minor
      Found in input_emojis/input_emojis.py - About 35 mins to fix

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

            def movable(self, from_x, from_y, to_x, to_y, promote):
        Severity: Minor
        Found in app/modules/shogi.py - About 35 mins to fix

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

              def basic_move(channel_id, from_x, from_y, to_x, to_y, promote):
          Severity: Minor
          Found in app/modules/shogi_input.py - About 35 mins to fix

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

                def move(self, from_x, from_y, to_x, to_y, promote):
            Severity: Minor
            Found in app/modules/shogi_input.py - About 35 mins to fix

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

              def make_user_text(user_name, motigoma,
              Severity: Minor
              Found in app/modules/shogi_output.py - About 35 mins to fix

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

                    def move(self, from_x, from_y, to_x, to_y, promote):
                Severity: Minor
                Found in app/modules/shogi.py - About 35 mins to fix

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

                      def koma_is_movable(channel_id, user_id, position, koma, sub_position, promote):
                  Severity: Minor
                  Found in app/modules/shogi_input.py - About 35 mins to fix

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

                            if input_str.find("寄") != -1:
                                from_flag = 16
                                input_str = input_str.replace("寄", "")
                    Severity: Minor
                    Found in app/modules/parse_input.py and 2 other locations - About 35 mins to fix
                    app/modules/parse_input.py on lines 158..160
                    app/modules/parse_input.py on lines 189..191

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 33.

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

                    movable_positions[Koma.opponent_kyosha] = [
                        [0, 1], [0, 2], [0, 3], [0, 4], [0, 5], [0, 6], [0, 7], [0, 8]]
                    Severity: Minor
                    Found in app/modules/shogi.py and 2 other locations - About 35 mins to fix
                    app/modules/shogi.py on lines 318..318
                    app/modules/shogi.py on lines 324..324

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

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

                            if input_str.find("直") != -1:
                                from_flag = 17
                                input_str = input_str.replace("直", "")
                    Severity: Minor
                    Found in app/modules/parse_input.py and 2 other locations - About 35 mins to fix
                    app/modules/parse_input.py on lines 158..160
                    app/modules/parse_input.py on lines 185..187

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

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

                        Koma.gyoku: [[-1, -1], [0, -1], [1, -1], [-1, 0], [1, 0], [-1, 1], [0, 1], [1, 1]],
                    Severity: Minor
                    Found in app/modules/shogi.py and 2 other locations - About 35 mins to fix
                    app/modules/shogi.py on lines 318..318
                    app/modules/shogi.py on lines 334..335

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

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

                        Koma.kyosha: [[0, -1], [0, -2], [0, -3], [0, -4], [0, -5], [0, -6], [0, -7], [0, -8]],
                    Severity: Minor
                    Found in app/modules/shogi.py and 2 other locations - About 35 mins to fix
                    app/modules/shogi.py on lines 324..324
                    app/modules/shogi.py on lines 334..335

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

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

                            if input_str.find("上") != -1:
                                from_flag = 1
                                input_str = input_str.replace("上", "")
                    Severity: Minor
                    Found in app/modules/parse_input.py and 2 other locations - About 35 mins to fix
                    app/modules/parse_input.py on lines 185..187
                    app/modules/parse_input.py on lines 189..191

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 33.

                    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

                    Avoid too many return statements within this function.
                    Open

                                        return False
                    Severity: Major
                    Found in app/modules/shogi.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return False
                      Severity: Major
                      Found in app/modules/shogi.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return False
                        Severity: Major
                        Found in app/modules/shogi.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return False
                          Severity: Major
                          Found in app/modules/parse_input.py - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language