DivanteLtd/anonymizer

View on GitHub

Showing 3 of 5 total issues

Method upload_to_web has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.upload_to_web(project_name, database, web_server, tmp_dir, options = '')
Severity: Minor
Found in lib/anonymizer/helper/shell_helper.rb - About 35 mins to fix

    Method initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def initialize(project_name, config = nil)
        raise 'Invalid project name' unless project_name && project_name.is_a?(String)
        @project_name = project_name
    
        if config.nil?
    Severity: Minor
    Found in lib/anonymizer/model/anonymizer.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 deep_merge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def deep_merge(second)
        merger = proc do |_key, v1, v2|
          if v1.is_a?(Hash) && v2.is_a?(Hash)
            v1.merge(v2, &merger)
          elsif v1.is_a?(Array) && v2.is_a?(Array)
    Severity: Minor
    Found in lib/anonymizer/helper/hash_helper.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

    Severity
    Category
    Status
    Source
    Language