timeyyy/pytknvim

View on GitHub

Showing 30 of 30 total issues

Avoid too many return statements within this function.
Open

                        return run_func()
Severity: Major
Found in pytknvim/util.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return
    Severity: Major
    Found in pytknvim/util.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return
      Severity: Major
      Found in pytknvim/util.py - About 30 mins to fix

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

            def scroll(self, count):
                """Shift scroll region."""
                top, bot = self.top, self.bot
                left, right = self.left, self.right
                if count > 0:
        Severity: Minor
        Found in pytknvim/screen.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

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

        def attach_headless(nvim_args=None, path=None):
            if not path:
                path = '/tmp/nvim' + rand_str(8)
            os.environ['NVIM_LISTEN_ADDRESS'] = path
            dnull = open(os.devnull)
        Severity: Minor
        Found in pytknvim/util.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

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

            def _tk_key(self, event):
                if 0xffe1 <= event.keysym_num <= 0xffee:
                    # this is a modifier key, ignore. Source:
                    # https://www.tcl.tk/man/tcl8.4/TkCmd/keysyms.htm
                    return
        Severity: Minor
        Found in pytknvim/tarruda.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

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

            def _tk_nvim_put(self, data):
                # choose a Font instance
                font = self._fnormal
                if self._attrs.get('bold', False):
                    font = self._fbold
        Severity: Minor
        Found in pytknvim/tarruda.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

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

            def _tk_nvim_put(self, data):
                # choose a Font instance
                font = self._fnormal
                if self._attrs.get('bold', False):
                    font = self._fbold
        Severity: Minor
        Found in pytknvim/tk_canvas.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

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

            def _tk_key(self, event):
                if 0xffe1 <= event.keysym_num <= 0xffee:
                    # this is a modifier key, ignore. Source:
                    # https://www.tcl.tk/man/tcl8.4/TkCmd/keysyms.htm
                    return
        Severity: Minor
        Found in pytknvim/tk_canvas.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

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

            def tk_key_pressed(self,event, **k):
                keysym = event.keysym
                state = parse_tk_state(event.state)
                if event.char not in ('', ' ') \
                            and state in (None, 'Shift'):
        Severity: Minor
        Found in pytknvim/tk_ui.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

        Severity
        Category
        Status
        Source
        Language