Dance   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
dl 20
loc 20
rs 10
c 0
b 0
f 0
wmc 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 7 7 2
A __init__() 11 11 3

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1 View Code Duplication
class Dance:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2
  def __init__(self, events=None, printer_handle=None, bot=None, say=None):
3
    self.events = events
4
    self.printer = printer_handle
5
    self.interests = ['__.dance__']
6
    self.bot = bot 
7
8
    self.help = ".dance"
9
10
    for event in events:
11
      if event._type in self.interests:
12
        event.subscribe(self)
13
14
  def handle(self, event):
15
    try:
16
      self.printer("PRIVMSG " + event.channel + " : :D-\-< " + '\n')
17
      self.printer("PRIVMSG " + event.channel + " : :D-|-< " + '\n')
18
      self.printer("PRIVMSG " + event.channel + " : :D-/-< " + '\n')
19
    except TypeError:
20
      pass
21