thenaterhood/gscreenshot

View on GitHub

Showing 22 of 22 total issues

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

    def apply_to(self, screenshot: Image.Image) -> Image.Image:
        '''apply the effect'''

        cursor_pos = self._position
        cursor_img = self._glyph.copy()
Severity: Minor
Found in src/gscreenshot/screenshot/effects/stamp.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 save_screenshot_collection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def save_screenshot_collection(self, foldername: typing.Optional[str]=None) -> bool:
        '''
        Saves every image in the current screenshot collection
        '''

Severity: Minor
Found in src/gscreenshot/__init__.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