Growstuff/growstuff

View on GitHub
app/views/crops/show.html.haml

Summary

Maintainability
Test Coverage

View template is too long [156/100]
Open

            Wikihow instructions
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

Unexpected additional newlines at the end of the file.
Open

Severity: Minor
Found in app/views/crops/show.html.haml by editorconfig

The = symbol should have one space separating it from code
Open

          %span.badge.badge-primary.badge-pill=@crop.plantings.active.size
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

HamlLint/SpaceBeforeScript

Separate Ruby script indicators (-/=) from their code with a single space.

Bad: no space between = and some_expression haml =some_expression

Good haml = some_expression

Good haml - some_value = 'Hello World'

Ensuring space after -/= enforces a consistency that all HAML tags/script indicators are separated from their inline content by a space. Since it is optional to add a space after -/= but required when writing %tag or similar, the consistency is best enforced via a linter.

Classes should be listed before IDs (.map should precede #cropmap)
Open

      #cropmap.map
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

HamlLint/ClassesBeforeIds

Whether classes or ID attributes should be listed first in tags.

EnforcedStyle: 'class' (default)

Bad: ID before class haml %tag#id.class

Good haml %tag.class#id

These attributes should be listed in order of their specificity. Since the tag name (if specified) always comes first and has the lowest specificity, classes and then IDs should follow.

EnforcedStyle: 'id'

Bad: Class before ID haml %tag.class#id

Good haml %tag#id.class

As IDs are more significant than classes to the element they represent, IDs should be listed first and then classes should follow. This gives a more consistent vertical alignment of IDs.

Line is too long. [130/120]
Open

            = link_to 'https://www.google.com/search?q=' + CGI.escape(['Growing', @crop.name, current_member.location].join(' ')),
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

HamlLint/LineLength

Option Description
max Maximum number of columns a single line can have. (default 80)

Wrap lines at 80 characters. You can configure this amount via the max option on the linter, e.g. by adding the following to your .haml-lint.yml:

linters:
  LineLength:
    max: 100

Long lines are harder to read and usually indicative of complexity. You can avoid them by splitting long attribute hashes on a comma, for example:

%tag{ attr1: 1,
      attr2: 2,
      attr3: 3 }

This significantly improves readability.

The = symbol should have one space separating it from code
Open

          %span.badge.badge-primary.badge-pill=@crop.harvests.size
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

HamlLint/SpaceBeforeScript

Separate Ruby script indicators (-/=) from their code with a single space.

Bad: no space between = and some_expression haml =some_expression

Good haml = some_expression

Good haml - some_value = 'Hello World'

Ensuring space after -/= enforces a consistency that all HAML tags/script indicators are separated from their inline content by a space. Since it is optional to add a space after -/= but required when writing %tag or similar, the consistency is best enforced via a linter.

The = symbol should have one space separating it from code
Open

          %span.badge.badge-primary.badge-pill=@crop.seeds.size
Severity: Info
Found in app/views/crops/show.html.haml by haml-lint

HamlLint/SpaceBeforeScript

Separate Ruby script indicators (-/=) from their code with a single space.

Bad: no space between = and some_expression haml =some_expression

Good haml = some_expression

Good haml - some_value = 'Hello World'

Ensuring space after -/= enforces a consistency that all HAML tags/script indicators are separated from their inline content by a space. Since it is optional to add a space after -/= but required when writing %tag or similar, the consistency is best enforced via a linter.

There are no issues that match your filters.

Category
Status