project-capo/amber-python-clients

View on GitHub

Showing 51 of 59 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def handle_data_msg(self, header, message):
        self.__logger.debug('Handling data message')

        if not message.HasField('ackNum') or message.ackNum == 0:
            if message.HasExtension(hokuyo_pb2.scan):
Severity: Major
Found in src/amberclient/hokuyo/hokuyo.py and 1 other location - About 1 day to fix
src/amberclient/ninedof/ninedof.py on lines 53..67

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 155.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def handle_data_msg(self, header, message):
        self.__logger.debug('Handling data message')

        if not message.HasField('ackNum') or message.ackNum == 0:
            if message.HasExtension(ninedof_pb2.sensorData):
Severity: Major
Found in src/amberclient/ninedof/ninedof.py and 1 other location - About 1 day to fix
src/amberclient/hokuyo/hokuyo.py on lines 54..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 155.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class Result(future_object.FutureObject):
    def __init__(self):
        super(Result, self).__init__()
        self.__result, self.__location = None, None

Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 1 other location - About 1 day to fix
src/amberclient/dummy/dummy.py on lines 155..174

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 127.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class Status(future_object.FutureObject):
    def __init__(self):
        super(Status, self).__init__()
        self.__message, self.__enable = None, None

Severity: Major
Found in src/amberclient/dummy/dummy.py and 1 other location - About 1 day to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 218..237

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 127.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @staticmethod
    def __build_subscription_action_msg(freq, accel, gyro, magnet):
        driver_msg = drivermsg_pb2.DriverMsg()
        driver_msg.type = drivermsg_pb2.DriverMsg.DATA
        driver_msg.Extensions[ninedof_pb2.subscribeAction].freq = freq
Severity: Major
Found in src/amberclient/ninedof/ninedof.py and 1 other location - About 6 hrs to fix
src/amberclient/roboclaw/roboclaw.py on lines 41..49

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    @staticmethod
    def __build_send_motors_command_req_msg(front_left, front_right, rear_left, rear_right):
        driver_msg = drivermsg_pb2.DriverMsg()
        driver_msg.type = drivermsg_pb2.DriverMsg.DATA
        driver_msg.Extensions[roboclaw_pb2.motorsCommand].frontLeftSpeed = front_left
Severity: Major
Found in src/amberclient/roboclaw/roboclaw.py and 1 other location - About 6 hrs to fix
src/amberclient/ninedof/ninedof.py on lines 43..51

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def handle_data_msg(self, header, message):
        self.__logger.debug('Handling data message.')

        if message.HasField('ackNum') and message.ackNum != 0:
            obj = self.get_future_object(message.ackNum)
Severity: Major
Found in src/amberclient/roboclaw/roboclaw.py and 1 other location - About 4 hrs to fix
src/amberclient/location/location.py on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def handle_data_msg(self, header, message):
        self.__logger.debug('Handling data message')
        if message.HasField('ackNum') and message.ackNum != 0:
            obj = self.get_future_object(message.ackNum)
            if isinstance(obj, Location):
Severity: Major
Found in src/amberclient/location/location.py and 1 other location - About 4 hrs to fix
src/amberclient/roboclaw/roboclaw.py on lines 28..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_single_scan(self):
        self.__logger.debug('Get single scan')
        syn_num = self.get_next_syn_num()
        driver_msg = HokuyoProxy.__build_get_single_scan_req_msg(syn_num)
        scan = Scan()
Severity: Major
Found in src/amberclient/hokuyo/hokuyo.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_next_targets(self):
        self.__logger.debug('Get next targets')
        syn_num = self.get_next_syn_num()
        driver_msg = DriveToPointProxy.__build_get_next_targets_req_msg(syn_num)
        result = Result()
Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_next_target(self):
        self.__logger.debug('Get next target')
        syn_num = self.get_next_syn_num()
        driver_msg = DriveToPointProxy.__build_get_next_target_req_msg(syn_num)
        result = Result()
Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_visited_targets(self):
        self.__logger.debug('Get visited targets')
        syn_num = self.get_next_syn_num()
        driver_msg = DriveToPointProxy.__build_get_visited_targets_req_msg(syn_num)
        result = Result()
Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_current_motors_speed(self):
        self.__logger.debug('Getting current motors speed')
        syn_num = self.get_next_syn_num()
        current_speed_req_msg = RoboclawProxy.__build_current_speed_request_msg(syn_num)
        motors_current_speed = MotorsCurrentSpeed()
Severity: Major
Found in src/amberclient/roboclaw/roboclaw.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_configuration(self):
        self.__logger.debug('Get configuration')
        syn_num = self.get_next_syn_num()
        driver_msg = DriveToPointProxy.__build_get_configuration_req_msg(syn_num)
        result = Result()
Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_visited_target(self):
        self.__logger.debug('Get visited target')
        syn_num = self.get_next_syn_num()
        driver_msg = DriveToPointProxy.__build_get_visited_target_req_msg(syn_num)
        result = Result()
Severity: Major
Found in src/amberclient/drive_to_point/drive_to_point.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/location/location.py on lines 35..42
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

    def get_location(self):
        self.__logger.debug('Get location')
        syn_num = self.get_next_syn_num()
        driver_msg = LocationProxy.__build_get_location_req_msg(syn_num)
        location = Location()
Severity: Major
Found in src/amberclient/location/location.py and 7 other locations - About 3 hrs to fix
src/amberclient/drive_to_point/drive_to_point.py on lines 60..67
src/amberclient/drive_to_point/drive_to_point.py on lines 77..84
src/amberclient/drive_to_point/drive_to_point.py on lines 94..101
src/amberclient/drive_to_point/drive_to_point.py on lines 111..118
src/amberclient/drive_to_point/drive_to_point.py on lines 128..135
src/amberclient/hokuyo/hokuyo.py on lines 70..77
src/amberclient/roboclaw/roboclaw.py on lines 51..58

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 73.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def subscribe(self, listener):
        """
        Subscribe for data provided by remote object.

        :param listener:
Severity: Major
Found in src/amberclient/dummy/dummy.py and 1 other location - About 2 hrs to fix
src/amberclient/dummy/dummy.py on lines 47..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def unsubscribe(self, listener=None):
        """
        Disable subscription.

        :return:
Severity: Major
Found in src/amberclient/dummy/dummy.py and 1 other location - About 2 hrs to fix
src/amberclient/dummy/dummy.py on lines 28..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def subscribe(self, listener):
        self.__logger.debug('Subscribe')
        listeners_count = self.append_listener(listener)
        if listeners_count == 0:
            driver_msg = HokuyoProxy.__build_subscribe_action_msg()
Severity: Major
Found in src/amberclient/hokuyo/hokuyo.py and 1 other location - About 2 hrs to fix
src/amberclient/hokuyo/hokuyo.py on lines 41..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    def unsubscribe(self, listener=None):
        self.__logger.debug('Unsubscribe')
        listeners_length = self.remove_listener(listener)
        if listeners_length == 0:
            driver_msg = HokuyoProxy.__build_unsubscribe_action_msg()
Severity: Major
Found in src/amberclient/hokuyo/hokuyo.py and 1 other location - About 2 hrs to fix
src/amberclient/hokuyo/hokuyo.py on lines 28..33

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 58.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language