PyDMXControl.profiles.Stairville._LED_Par_36   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 45.83 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 11
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A LED_Par_36.__init__() 11 11 1

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
"""
2
 *  PyDMXControl: A Python 3 module to control DMX using OpenDMX or uDMX.
3
 *                Featuring fixture profiles, built-in effects and a web control panel.
4
 *  <https://github.com/MattIPv4/PyDMXControl/>
5
 *  Copyright (C) 2018 Matt Cowley (MattIPv4) ([email protected])
6
"""
7
8
from ..defaults import Vdim
9
10
11
class LED_Par_36(Vdim):
12
13 View Code Duplication
    def __init__(self, *args, **kwargs):
14
        super().__init__(*args, **kwargs)
15
16
        self._register_channel('mode')
17
        self._register_channel('red', vdim=True)
18
        self._register_channel_aliases('red', 'r')
19
        self._register_channel('green', vdim=True)
20
        self._register_channel_aliases('green', 'g')
21
        self._register_channel('blue', vdim=True)
22
        self._register_channel_aliases('blue', 'b')
23
        self._register_channel('speed')
24