Jam3/adviser

View on GitHub

Showing 2,428 of 2,428 total issues

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

'use strict';

const path = require('path');
const cosmiconfig = require('cosmiconfig');
const Config = require('../../src/core/config/config');
Severity: Minor
Found in __tests__/core/config.test.js - About 3 hrs to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    class InvalidRuleError extends Error {
      constructor(message, ruleName, error) {
        super(message);
        this.name = this.constructor.name;
        Error.captureStackTrace(this, InvalidRuleError);
    Severity: Major
    Found in src/core/errors/exceptions/invalid-rule-error.js and 2 other locations - About 3 hrs to fix
    src/core/errors/exceptions/config-file-validation-error.js on lines 16..25
    src/core/errors/exceptions/plugin-error.js on lines 16..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 96.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    class ConfigFileValidationError extends Error {
      constructor(message, path, errors) {
        super(message);
        this.name = this.constructor.name;
        Error.captureStackTrace(this, ConfigFileValidationError);
    Severity: Major
    Found in src/core/errors/exceptions/config-file-validation-error.js and 2 other locations - About 3 hrs to fix
    src/core/errors/exceptions/invalid-rule-error.js on lines 16..25
    src/core/errors/exceptions/plugin-error.js on lines 16..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 96.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (blocklistedFiles) {
          const notAllowedFiles = blocklistedFiles.filter(blocklistedFile => files.includes(blocklistedFile));
    
          if (notAllowedFiles.length > 0) {
            sandbox.report({
    Severity: Major
    Found in src/core/built-in/rules/root-files.js and 1 other location - About 3 hrs to fix
    src/core/built-in/rules/package-json-properties.js on lines 44..55

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 96.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    class PluginError extends Error {
      constructor(message, pluginName, error) {
        super(message);
        this.name = this.constructor.name;
        Error.captureStackTrace(this, PluginError);
    Severity: Major
    Found in src/core/errors/exceptions/plugin-error.js and 2 other locations - About 3 hrs to fix
    src/core/errors/exceptions/config-file-validation-error.js on lines 16..25
    src/core/errors/exceptions/invalid-rule-error.js on lines 16..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 96.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        if (blocklistedProps) {
          const notAllowedProps = blocklistedProps.filter(blocklistedProp => packagejson.hasOwnProperty(blocklistedProp));
    
          if (notAllowedProps.length > 0) {
            sandbox.report({
    Severity: Major
    Found in src/core/built-in/rules/package-json-properties.js and 1 other location - About 3 hrs to fix
    src/core/built-in/rules/root-files.js on lines 47..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 96.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function render has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        return (
          <footer className="nav-footer" id="footer">
            <section className="sitemap">
              <a href={this.props.config.baseUrl} className="nav-home">
    Severity: Major
    Found in docusaurus/website/core/Footer.js - About 2 hrs to fix

      Function base has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function base(results, rules) {
        let output = `\n  ${chalk.blue('Output')} \n\n`;
        let summaryColor = 'yellow';
      
        if (results.items.length === 0) {
      Severity: Major
      Found in src/core/formatters/base.js - About 2 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          test('Load plugin with invalid location', () => {
            function load() {
              plugins.load(pluginName, '');
            }
        
        
        Severity: Major
        Found in __tests__/core/plugin.test.js and 1 other location - About 2 hrs to fix
        __tests__/core/plugin.test.js on lines 48..57

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 76.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          test('Load plugin with whitespaces', () => {
            function load() {
              plugins.load(pluginName, '');
            }
        
        
        Severity: Major
        Found in __tests__/core/plugin.test.js and 1 other location - About 2 hrs to fix
        __tests__/core/plugin.test.js on lines 59..68

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 76.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            fileExplorer.searchSync = jest.fn(() => {
              return {
                config: {
                  plugins: ['test1', 'test2', 'test3'],
                  rules: {
        Severity: Major
        Found in __tests__/core/config.test.js and 2 other locations - About 1 hr to fix
        __tests__/core/config.test.js on lines 122..133
        __tests__/core/config.test.js on lines 148..159

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            fileExplorer.loadSync = jest.fn(() => {
              return {
                config: {
                  plugins: ['test1', 'test2', 'test3'],
                  rules: {
        Severity: Major
        Found in __tests__/core/config.test.js and 2 other locations - About 1 hr to fix
        __tests__/core/config.test.js on lines 122..133
        __tests__/core/config.test.js on lines 170..181

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            fileExplorer.loadSync = jest.fn(() => {
              return {
                config: {
                  plugins: ['test1', 'test2', 'test3'],
                  rules: {
        Severity: Major
        Found in __tests__/core/config.test.js and 2 other locations - About 1 hr to fix
        __tests__/core/config.test.js on lines 148..159
        __tests__/core/config.test.js on lines 170..181

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function render has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { siteConfig, language = '' } = this.props;
            const { baseUrl, docsUrl } = siteConfig;
            const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
            const langPart = `${language ? `${language}/` : ''}`;
        Severity: Minor
        Found in docusaurus/website/pages/en/index.js - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              const Installation = () => (
                <Block background="dark" className="landingSteps">
                  {[
                    {
                      content: `Adviser was created using Node.js and can be **installed using npm**.
          Severity: Major
          Found in docusaurus/website/pages/en/index.js and 1 other location - About 1 hr to fix
          docusaurus/website/pages/en/index.js on lines 111..128

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 72.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              const Use = () => (
                <Block background="light" className="landingSteps">
                  {[
                    {
                      content: `Adviser **behaves like the linters the community is used** to avoid the learning curve. The arguments are really similar ESLint, Stylelint and other famous linters.
          Severity: Major
          Found in docusaurus/website/pages/en/index.js and 1 other location - About 1 hr to fix
          docusaurus/website/pages/en/index.js on lines 130..147

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 72.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              const PromoSection = props => (
                <div className="section promoSection">
                  <div className="promoRow">
                    <div className="pluginRowBlock">{props.children}</div>
                  </div>
          Severity: Major
          Found in docusaurus/website/pages/en/index.js and 1 other location - About 1 hr to fix
          docusaurus/website/pages/en/index.js on lines 24..30

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 69.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              const SplashContainer = props => (
                <div className="homeContainer">
                  <div className="homeSplashFade">
                    <div className="wrapper homeWrapper">{props.children}</div>
                  </div>
          Severity: Major
          Found in docusaurus/website/pages/en/index.js and 1 other location - About 1 hr to fix
          docusaurus/website/pages/en/index.js on lines 44..50

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 69.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function runLifeCycle has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async runLifeCycle(currentDirectory, verboseMode, reportCallback, asyncCallback) {
              if (this.severity === SeverityEnum.Off) {
                asyncCallback();
                return;
              }
          Severity: Minor
          Found in src/core/rule/rule.js - About 1 hr to fix

            Function _formatSchemaErrors has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              _formatSchemaErrors(errors) {
                const filteredRules = [];
            
                return errors
                  .map(error => {
            Severity: Minor
            Found in src/core/config/schema-validator.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language