indentlabs/notebook

View on GitHub

Showing 183 of 288 total issues

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

  def babel
    EasyTranslate.api_key = ENV['GOOGLE_TRANSLATE_API_KEY']

    @translations = [["afrikaans", "amarach"], ["albanian", "amarach"], ["arabic", "amarach"], ["belarusian", "amarach"], ["bulgarian", "amarach"], ["catalan", "Amarachi"], ["chinese_simplified", "amarach"], ["chinese_traditional", "amarach"], ["croatian", "Amarachi"], ["czech", "Amarachi"], ["danish", "Amarach"], ["dutch", "Amarach"], ["estonian", "Amarachi"], ["filipino", "Amarach"], ["finnish", "Amarachi"], ["french", "Amarach"], ["galician", "Amarachi"], ["german", "Amarach"], ["greek", "amarach"], ["hebrew", "amarach"], ["hindi", "Amrc"], ["hungarian", "Amarachi"], ["icelandic", "Amarachi"], ["indonesian", "Amarach"], ["irish", "tomorrow"], ["italian", "Amarach"], ["japanese", "amarach"], ["korean", "amarach"], ["latin", "amarach"], ["latvian", "Amárach"], ["lithuanian", "Amarachi"], ["macedonian", "amarach"], ["malay", "Amarach"], ["maltese", "Amárach"], ["norwegian", "Amarach"], ["persian", "amarach"], ["polish", "Amarach"], ["portuguese", "Amarach"], ["romanian", "Amarachi"], ["russian", "amarach"], ["serbian", "Amarachi"], ["slovak", "Amarach"], ["slovenian", "Amarachi"], ["spanish", "Amarach"], ["swahili", "amarach"], ["swedish", "Amarach"], ["thai", "amarach"], ["turkish", "Amarachi"], ["ukrainian", "amarach"], ["vietnamese", "amarach"], ["welsh", "amarach"], ["yiddish", "amarach"]]

Severity: Minor
Found in app/controllers/lab_controller.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 analyze has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def self.analyze(analysis_id)
          analysis = ::DocumentAnalysis.find(analysis_id)
          document = analysis.document

          watson_client = new_client
Severity: Minor
Found in app/services/documents/analysis/third_party/ibm_watson_service.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 link_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.link_for(content_model)
    [
      Rails.env.production? ? 'https://' : 'http://',
      Rails.env.production? ? 'www.notebook.ai' : 'localhost:3000', # Rails.application.routes.default_url_options[:host]?
      content_model.class.name != Document.name ? '/plan/' : '/',
Severity: Minor
Found in app/services/content_formatter_service.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