k-ta-yamada/k-ta-yamada

View on GitHub

Showing 5 of 5 total issues

Function exports has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (env) => {
  return {
    entry: {
      app:        './sources/app.bundle.js',
      rubygems:   './sources/rubygems.bundle.js',
Severity: Major
Found in webpack.config.js - About 2 hrs to fix

    Method to_i_to_sym has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def to_i_to_sym(task, result)
          [task.to_i.zero? ? task.to_sym : task.to_i,
           result.nil? ? nil : result.to_i]
        end
    Severity: Minor
    Found in app.rb - About 45 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 decorate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def decorate(task, result)
          [task.is_a?(Numeric) ? "#{task} sec" : task,
           result.is_a?(Numeric) ? "#{result} sec" : result]
        end
    Severity: Minor
    Found in app.rb - About 45 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 rest? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def rest?(task)
          return nil if task.is_a?(Numeric)
    
          task == :rest ? 'info' : nil
        end
    Severity: Minor
    Found in app.rb - About 35 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 js has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def js(filename)
        basename = File.basename(filename, '.*').to_sym
        name = basename == :layout ? :app : basename
        hash = settings.production? ? JS_HASH : js_hash
        "js/#{name}-#{hash}.js"
    Severity: Minor
    Found in app.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