weareopensource/conventional-changelog

View on GitHub

Showing 5 of 20 total issues

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

module.exports = (options) => {
  const types = options.types;

  const length = longest(Object.keys(types)).length + 1;
  const choices = map(types, (type, key) => ({
Severity: Major
Found in engine.js - About 5 hrs to fix

    File engine.test.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint guard-for-in: 0 */
    /* eslint no-restricted-syntax: 0 */
    
    const types = require('conventional-commit-types').types;
    const chalk = require('chalk');
    Severity: Minor
    Found in engine.test.js - About 5 hrs to fix

      Function prompter has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          prompter(cz, commit) {
            cz.prompt([
              {
                type: 'list',
                name: 'type',
      Severity: Major
      Found in engine.js - About 5 hrs to fix

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

        module.exports = (options) => {
          const types = options.types;
        
          const length = longest(Object.keys(types)).length + 1;
          const choices = map(types, (type, key) => ({
        Severity: Minor
        Found in engine.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 processQuestions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function processQuestions(questions, answers) {
          for (const i in questions) {
            const question = questions[i];
            const answer = answers[question.name];
            const validation = answer === undefined || !question.validate
        Severity: Minor
        Found in engine.test.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

        Severity
        Category
        Status
        Source
        Language