Skip to content

Detects "Identical blocks of code" that are in no way identical #290

Open
@pitaj

Description

@pitaj

https://codeclimate.com/github/benchpressjs/benchpressjs/issues

If you scroll down to the two Identical blocks of code found in 2 locations. Consider refactoring. issues, you will see that it detects

  return Promise.try(() => {
    Benchpress.cache[template] = Benchpress.cache[template] || load(template);
    return Benchpress.cache[template];
  }).then((templateFunction) => {
    if (block) {

and

  return Promise.try(() => {
    const cached = compileRenderCache.get(hash);
    if (cached) {
      compileRenderCache.ttl(hash);
      return cached;

as identical when the only thing even similar about them is Promise.try(() => {.

This is super annoying. Is it some kind of diffing or hashing bug? Should I report it on the flay repository?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions