ovidiuionut94/djin

View on GitHub

Showing 10 of 10 total issues

Function shortestPath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    shortestPath(source, target) {
        if (source === target) {
            return source
        }

Severity: Minor
Found in src/mysql/path/BFS.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 shortestPath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    shortestPath(source, target) {
        if (source === target) {
            return source
        }

Severity: Minor
Found in src/mysql/path/BFS.js - About 1 hr to fix

    Function translateJson has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        translateJson(jsonTree, parentNode) {
            Object.keys(jsonTree).forEach(treeKey => {
                const keyValue = jsonTree[treeKey]
    
                let selector = {
    Severity: Minor
    Found in src/core/analyzer.js - About 1 hr to fix

      Function generateJoin has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function generateJoin(selector, tableToJoin, tableToJoinColumn, parentTable, parentColumn) {
      Severity: Minor
      Found in src/mysql/get/queryBuilder.js - About 35 mins to fix

        Avoid too many return statements within this function.
        Open

            return new InnerJoin(tableToJoin, tableToJoinColumn, parentTable, parentColumn)
        Severity: Major
        Found in src/mysql/get/queryBuilder.js - About 30 mins to fix

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

          function applySelectKeysToQuery(query, fieldsToSelect, dataSource) {
              if (!query) {
                  query = ''
              } else {
                  query += ', '
          Severity: Minor
          Found in src/models/query/selectBase.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

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

              constructor(baseQuery, joinsToAppend, condition) {
                  if (typeof baseQuery === 'object' && baseQuery.constructor.name === 'SelectBase') {
                      this.query = baseQuery.getSelectBase()
                  } else {
                      this.query = baseQuery || ''
          Severity: Minor
          Found in src/models/query/selectQuery.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

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

          function generateJoin(selector, tableToJoin, tableToJoinColumn, parentTable, parentColumn) {
              if (selector.innerJoin || selector.InnerJoin) {
                  return new InnerJoin(tableToJoin, tableToJoinColumn, parentTable, parentColumn)
              }
              if (selector.rightJoin || selector.RightJoin) {
          Severity: Minor
          Found in src/mysql/get/queryBuilder.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

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

              initGraphEdges() {
                  for (let i = 0; i < this.nodes.length - 1; i++) {
                      for (let j = i + 1; j < this.nodes.length; j++) {
                          const firstTable = this.nodes[i].tableName
                          const secondTable = this.nodes[j].tableName
          Severity: Minor
          Found in src/mysql/path/BFS.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

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

          function manipulateSelectQuery(selectQuery, insertedId) {
              let select = null
              if (selectQuery.sql) {
                  select = selectQuery.sql
              } else {
          Severity: Minor
          Found in src/mysql/queryExecuter.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