mberlanda/cheidelacoriera

View on GitHub

Showing 5 of 25 total issues

Method process has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def process
    File.readlines(@input_file).each do |line|
      matched = line.match(insert_regex)
      next unless matched

Severity: Minor
Found in app/lib/dump_processor.rb - About 1 hr 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

Function prepareButton has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function prepareButton(button){
  button.addEventListener('click', function(){
    fullscreen(button);
  }, false);

Severity: Minor
Found in app/views/albums/fullscreen.js - About 1 hr 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

Function prepareButton has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function prepareButton(button){
  button.addEventListener('click', function(){
    fullscreen(button);
  }, false);

Severity: Minor
Found in app/views/albums/fullscreen.js - About 1 hr to fix

    Function initializeFullScreen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    function initializeFullScreen(){
      // detect enter or exit fullscreen mode
      document.addEventListener('webkitfullscreenchange', fullscreenChange);
      document.addEventListener('mozfullscreenchange', fullscreenChange);
      document.addEventListener('fullscreenchange', fullscreenChange);
    Severity: Minor
    Found in app/views/albums/fullscreen.js - 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

    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(api) {
      var validEnv = ['development', 'test', 'production']
      var currentEnv = api.env()
      var isDevelopmentEnv = api.env('development')
      var isProductionEnv = api.env('production')
    Severity: Minor
    Found in babel.config.js - 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