leapfrogtechnology/chill

View on GitHub

Showing 7 of 71 total issues

Function configureWebpack has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function configureWebpack() {
  const config = await init();

  return {
    mode: 'development',
Severity: Major
Found in dashboard/webpack.config.js - About 3 hrs to fix

    Function configureWebpack has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function configureWebpack() {
      const config = await init();
      const baseUrl = config.dashboard.baseUrl || '';
    
      return {
    Severity: Major
    Found in dashboard/webpack.config.production.js - About 3 hrs to fix

      Function withStatusInfo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const withStatusInfo = WrappedComponent => {
        return class extends Component {
          constructor() {
            super();
            this.state = {
      Severity: Minor
      Found in dashboard/src/components/hoc/status.js - About 1 hr to fix

        Function createLogger has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createLogger(config) {
          const {
            level,
            logDir,
            maxFiles,
        Severity: Minor
        Found in core/src/utils/logger.js - About 1 hr to fix

          Function createLogger has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createLogger(config) {
            const {
              level,
              logDir,
              maxFiles,
          Severity: Minor
          Found in monitor/src/utils/logger.js - About 1 hr to fix

            Function createLogger has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function createLogger(config) {
              const { level, logDir, maxFiles, jsonFormat, dateFormat } = config;
            
              createDirectory(logDir);
            
            
            Severity: Minor
            Found in api/src/utils/logger.js - About 1 hr to fix

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

              export async function checkHostStatus(service, method = http.OPTIONS) {
                const { url, name, auth } = service;
                const token = tokenService.getToken(auth);
              
                logger().debug(`Checking the status for ${name} <${url}>`);
              Severity: Minor
              Found in monitor/src/services/status.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