crowdint/blog.crowdint.com

View on GitHub

Showing 4 of 4 total issues

Function swipeRight has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    swipeRight: function(event, direction, distance, duration, fingerCount){
Severity: Minor
Found in app/assets/javascripts/mobile-menu.js - About 35 mins to fix

    Method sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def sync
        delta = client.delta delta_cursor
        puts delta
        delta_hash = parse_delta(delta)
        delta_hash.each do |k, v|
    Severity: Minor
    Found in app/models/user_dropbox_session.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.query(query)
        dates = self.date_range(query)
        Post.search do
          fulltext query[:q]
          with(:author_id, query[:author].to_i) if query[:author].present?
    Severity: Minor
    Found in app/models/post.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method expire_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def expire_all(post)
        # Not sure whats happening here with the engine routes
        if post.published?
          if main_app
            expire_action main_app.post_url(*post.url_params)
    Severity: Minor
    Found in app/sweepers/post_sweeper.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Severity
    Category
    Status
    Source
    Language