Saka7/sqlibri

View on GitHub

Showing 5 of 5 total issues

Function SqlHighlightRules has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var SqlHighlightRules = function() {

    var keywords = (
        "SELECT|INSERT|INTO|VALUES|UPDATE|DELETE|FROM|WHERE|AND|OR|GROUP|BY|ORDER|LIMIT|OFFSET|HAVING|AS|CASE|" +
        "WHEN|ELSE|END|TYPE|LEFT|RIGHT|JOIN|ON|OUTER|DESC|ASC|UNION|CREATE|TABLE|PRIMARY|KEY|IF|" +
Severity: Major
Found in src/com/sqlibri/control/editor/ace/mode-sql.js - About 2 hrs to fix

    File AppPresenter.java has 258 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.sqlibri.presenter;
    
    import com.sqlibri.App;
    import com.sqlibri.control.editor.SQLEditor;
    import com.sqlibri.model.Database;
    Severity: Minor
    Found in src/com/sqlibri/presenter/AppPresenter.java - About 2 hrs to fix

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

        public QueryResult executeQuery(String query) throws Exception, SQLException {
          QueryResult queryResult = new QueryResult();
          ResultSet resultSet = null;
          query = query.replaceAll("\\s+", " ");
      
      
      Severity: Minor
      Found in src/com/sqlibri/model/Database.java - 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

      Method executeQuery has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public QueryResult executeQuery(String query) throws Exception, SQLException {
          QueryResult queryResult = new QueryResult();
          ResultSet resultSet = null;
          query = query.replaceAll("\\s+", " ");
      
      
      Severity: Minor
      Found in src/com/sqlibri/model/Database.java - About 1 hr to fix

        Method execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          @FXML public void execute() {
            if (db == null || db.getFile() == null)
              return;
        
            String query = editor.getCode();
        Severity: Minor
        Found in src/com/sqlibri/presenter/AppPresenter.java - About 55 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