Which of the following best describes the primary function of a code analyzer in software development?
A) To manage version control and track changes in source code.
B) To detect and report potential errors, code smells, and security vulnerabilities in source code.
C) To optimize the performance of a compiled program by modifying the code.
D) To automate the process of writing unit tests for the codebase.