sentilo/sentilo

View on GitHub

Showing 593 of 1,220 total issues

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

      var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;
sentilo-catalog-web/src/main/webapp/static/js/markerclusterer.js on lines 477..477

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 48.

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

    actionButtonsGrp.append($('<a class="btn" href="#" id="expand-all"><i class="icon-resize-full"></i></a>')
        .on('click', function() {
            $(panel).jsonPresenter('expandAll');
        })
    );
sentilo-catalog-web/src/main/webapp/static/js/sentilo/media_players.js on lines 408..412

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 48.

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

        if(platformStatus.isPlatformRunningProperly){
            $('#globalPlatformMessage').append(globalPlatformMsgOk);
            $('#globalPlatformPanel').addClass('alert alert-success');
            $('#globalPlatformIconStatus').addClass('icon-ok');
        }else{
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/status.js and 1 other location - About 40 mins to fix
sentilo-catalog-web/src/main/webapp/static/js/sentilo/status.js on lines 7..11

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof AlertRule) || id == null) {
      return false;
    }
sentilo-agent-alert/src/main/java/org/sentilo/agent/alert/domain/InternalAlert.java on lines 66..73
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Alert.java on lines 129..136
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Application.java on lines 109..116
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Provider.java on lines 116..123
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/User.java on lines 111..118

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof InternalAlert) || id == null) {
      return false;
    }
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Alert.java on lines 129..136
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/AlertRule.java on lines 121..128
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Application.java on lines 109..116
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Provider.java on lines 116..123
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/User.java on lines 111..118

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof User) || userName == null) {
      return false;
    }
sentilo-agent-alert/src/main/java/org/sentilo/agent/alert/domain/InternalAlert.java on lines 66..73
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Alert.java on lines 129..136
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/AlertRule.java on lines 121..128
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Application.java on lines 109..116
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Provider.java on lines 116..123

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof Alert) || id == null) {
      return false;
    }
sentilo-agent-alert/src/main/java/org/sentilo/agent/alert/domain/InternalAlert.java on lines 66..73
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/AlertRule.java on lines 121..128
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Application.java on lines 109..116
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Provider.java on lines 116..123
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/User.java on lines 111..118

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof Application) || id == null) {
      return false;
    }
sentilo-agent-alert/src/main/java/org/sentilo/agent/alert/domain/InternalAlert.java on lines 66..73
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Alert.java on lines 129..136
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/AlertRule.java on lines 121..128
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Provider.java on lines 116..123
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/User.java on lines 111..118

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 48.

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

Identical blocks of code found in 6 locations. Consider refactoring.
Open

  @Override
  public boolean equals(final Object obj) {
    if (!(obj instanceof Provider) || id == null) {
      return false;
    }
sentilo-agent-alert/src/main/java/org/sentilo/agent/alert/domain/InternalAlert.java on lines 66..73
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Alert.java on lines 129..136
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/AlertRule.java on lines 121..128
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Application.java on lines 109..116
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/User.java on lines 111..118

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 48.

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

  @Override
  public void publish(final AlarmInputMessage message) {
    LOGGER.debug("Publishing alarm message {}", message);
    final RequestContext rc = RequestUtils.buildContext(message, converter.marshal(message));
    getRestClient().put(rc);
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultDataServiceOperationsImpl.java on lines 66..72

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 48.

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

  public Query getDistinctComponentByProviderTypeQuery(final String providerId) {
    final Query query = Query.query(Criteria.where("providerId").is(providerId));
    query.fields().include("componentType");
    query.fields().exclude("_id");
    return query;
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/service/impl/SensorTypesServiceImpl.java on lines 86..91

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 48.

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

  private String getUserDateFormatPattern(final User user) {
    if (user != null && user.getVisualConfiguration() != null && StringUtils.hasText(user.getVisualConfiguration().getDateFormatPattern())) {
      return user.getVisualConfiguration().getDateFormatPattern();
    }
    return null;
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/service/impl/UserConfigServiceImpl.java on lines 173..178

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 48.

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

  private String getUserTimeZone(final User user) {
    if (user != null && user.getVisualConfiguration() != null && StringUtils.hasText(user.getVisualConfiguration().getTimeZone())) {
      return user.getVisualConfiguration().getTimeZone();
    }
    return null;
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/service/impl/UserConfigServiceImpl.java on lines 180..185

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 48.

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

  @Override
  public void sendObservations(final DataInputMessage message) {
    LOGGER.debug("Sending observations  {}", message);
    final RequestContext rc = RequestUtils.buildContext(message, converter.marshal(message));
    getRestClient().put(rc);
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultAlarmServiceOperationsImpl.java on lines 52..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 48.

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

  public Query getDistinctSensorByProviderTypeQuery(final String providerId) {
    final Query query = Query.query(Criteria.where("providerId").is(providerId));
    query.fields().include("type");
    query.fields().exclude("_id");
    return query;
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/service/impl/ComponentTypesServiceImpl.java on lines 114..119

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 48.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

  @Override
  public String getId() {
    if (!StringUtils.hasText(id) && StringUtils.hasText(name) && StringUtils.hasText(providerId)) {
      id = buildId(providerId, name);
    }
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/DocumentFile.java on lines 112..118
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Sensor.java on lines 203..210

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 47.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

  @Override
  public String getId() {
    if (!StringUtils.hasText(id) && StringUtils.hasText(filename) && StringUtils.hasText(entityId)) {
      id = buildId(entityId, filename);
    }
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Component.java on lines 178..185
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Sensor.java on lines 203..210

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 47.

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

  @Override
  public String getId() {
    if (!StringUtils.hasText(id) && StringUtils.hasText(sensorId) && StringUtils.hasText(componentId)) {
      id = buildId(componentId, sensorId);
    }
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/Component.java on lines 178..185
sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/domain/DocumentFile.java on lines 112..118

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 47.

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 7 locations. Consider refactoring.
Open

  @Override
  public void updateSensors(final CatalogInputMessage message) {
    LOGGER.debug("Updating sensors");
    final RequestContext rc = RequestUtils.buildContext(message, converter.marshal(message));
    getRestClient().put(rc);
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 79..85
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 109..116
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 125..131
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 161..167
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 176..183
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 192..198

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 46.

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 7 locations. Consider refactoring.
Open

  @Override
  public void deleteProvider(final CatalogDeleteInputMessage message) {
    LOGGER.debug("Deleting provider components/sensors");
    final RequestContext rc = RequestUtils.buildContext(message, converter.marshal(message));
    getRestClient().delete(rc);
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 79..85
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 94..100
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 109..116
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 161..167
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 176..183
sentilo-platform-client-java/src/main/java/org/sentilo/platform/client/core/service/impl/DefaultCatalogServiceOperationsImpl.java on lines 192..198

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 46.

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