metanorma/metanorma-cli

View on GitHub

Showing 4 of 4 total issues

File command.rb has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "metanorma/cli/compiler"
require "metanorma/cli/generator"
require "metanorma/cli/collection"
require "metanorma/cli/git_template"
require "metanorma/cli/thor_with_config"
Severity: Minor
Found in lib/metanorma/cli/command.rb - About 2 hrs to fix

    Method run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def run
    if Cli.writable_templates_path?
    if name && document_path.exist?
    return unless overwrite?(document_path)
     
     
    Severity: Minor
    Found in lib/metanorma/cli/generator.rb - About 1 hr to fix

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

    def calculate_base_path!(my_options, manifest_path = nil)
    config_file = options[:config]
    if manifest_path.nil?
    if config_file.nil?
    # If no config file is given, use the current working directory
    Severity: Minor
    Found in lib/metanorma/cli/commands/site.rb - About 35 mins to fix

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

    def compile(file_name = nil)
    if file_name && !options[:version]
    documents = select_wildcard_documents(file_name) || [file_name]
    documents.each { |document| compile_document(document, options.dup) }
     
     
    Severity: Minor
    Found in lib/metanorma/cli/command.rb - About 25 mins to fix
    Severity
    Category
    Status
    Source
    Language