Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>bear-snifferNew to Visual Studio Code? Get it now.
bear-sniffer

bear-sniffer

The Bears

|
12 installs
| (0) | Free
A static analysis tool for education which identifies code smells
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Bear Sniffer

An extension for "sniffing" out code smells (like a bear) in your Python code.

Code smells are issues that may plague your code without you realising. They're are issues that don't neccesarily cause compile or runtime issues, but hint at future issues. They make code difficult to extend and maintain, and can make debugging more difficult.

This extension is designed to help you identify and fix some common code smells in your code. Only works on Python files, will not work on any file without a .py file extension. Intended to be used to aid beginner programmer students with little experience with programming and writing sustainable code.

Note that this tool is NOT EXHAUSTIVE. Bear Sniffer does not detect every possible code smell ever, just some of the common ones beginners may encounter. Once Bear Sniffer doesn't detect any more code smells we encourage you to still be thorough and check your work.

Features

Identifies specific code smells in the current Python file, identifiying which line(s) it's on and providing an explanation of what the smell is.

  • Finds what lines the smells occur on
  • Identifies the smell and categorises its severity
  • Provides an explanation of why the smell is a problem

How to Open

  1. Open VS Code and make sure you are not in Restricted Mode (Trust the folder), if your are in restricted mode the extension won't appear

  2. Open the Python file you want to sniff

  3. Open the extension through one of the following methods:

    • Hit CTRL + SHIFT + P (or MacOS: CMD SHIFT P) and search for "Bear Sniff"
    • Go to the search bar and type ">", then search for "Bear Sniff"

    alt text

    • Open the Bear Sniffer tab with the bear icon (usually found on the left sidebar)

    alt text

  4. Open on your Python file

How to Use

Bear Sniffer will sniff code smells in the current "focused" file when:

  • Bear Sniffer is opened
  • The current focused file is changed
  • The current file is saved
  • The refresh button in the UI is pressed This means that you don't need to worry about Bear Sniffer picking up on smells while you are still writing the code, though you will need to manually refresh if you want to detect fresh smells. Note that while open, Bear Sniffer will show what file is currently being sniffed.

The UI for Bear Sniffer looks like this:

alt text

While you have Bear Sniffer open on a Python file it will show all detected smells, sorted by line number. Each line with a smell on it will be underlined with a colour indicating its urgency. Selecting a smell will expand it, presenting an explanation of what it means. This will also move your cursor to the line and highlight it.

alt text

The filter buttons at the tope of the UI indicated the number of smells in each urgency category that has been detected. The categories are presented in blue, yellow and red for minor, major and critical smells respectively. Selecting the filter will let you filter for each urgency of smell.

alt text

If you have no smells in the file it will notify you. Note that if you have Bear Sniffer open on a non-Python file, it will inform you with a helpful image.

alt text

List of Code smells detected

  • Use of if statements when returning a boolean
  • Usage of iteration on the length of a list instead of iterators
  • Usage of nested if statements instead of using and statements
  • Having mutable default arguments for functions or classes
  • Error handling by catching overly broad exceptions using a try-catch
  • Use of else statement for an if statement that will never fall through
  • Overwriting default python names
  • Boolean comparison against a constant boolean
  • Functions of excessive length
  • Dead/unused Code

Requirements

Requires version 1.134.0 or greater of VSCode to use

Known Issues

Your code lol.

3.0.0

Final project release and submission

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft