Showing 5 of 17 total issues
Function main
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func main() {
app := cli.NewApp()
app.Usage = "CLI for kaede"
app.Commands = []cli.Command{
Class Recorder
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Recorder
def initialize(notifier)
@notifier = notifier
end
Method prepare_tables
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def prepare_tables
@db.create_table?(:channels) do
primary_key :id
String :name, size: 255, null: false, unique: true
Integer :for_recorder, null: false, unique: true
Function main
has 7 return statements (exceeds 4 allowed). Open
Open
func main() {
app := cli.NewApp()
app.Usage = "CLI for kaede"
app.Commands = []cli.Command{
Method redo_ts_process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def redo_ts_process(program)
unless system(Kaede.config.b25.to_s, '-v0', '-s1', '-m1', record_path(program).to_s, cache_path(program).to_s)
@notifier.notify_redo_error(program)
return false
end
- Read upRead up
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"