index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import React from 'react';
  2. import clsx from 'clsx';
  3. import Layout from '@theme/Layout';
  4. import Link from '@docusaurus/Link';
  5. import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
  6. import useBaseUrl from '@docusaurus/useBaseUrl';
  7. import styles from './styles.module.css';
  8. const features = [
  9. {
  10. title: <>Configurable</>,
  11. imageUrl: 'img/undraw_docusaurus_mountain.svg',
  12. description: (
  13. <>
  14. Define and apply your rules and policies.
  15. Integrate with your workflow.
  16. </>
  17. ),
  18. },
  19. {
  20. title: <>Extendable via plugins</>,
  21. imageUrl: 'img/undraw_docusaurus_mountain.svg',
  22. description: (
  23. <>
  24. Define your custom metric.
  25. Add new language parser.
  26. Create advanced post-analysis tool.
  27. </>
  28. ),
  29. },
  30. {
  31. title: <>Multiple metrics</>,
  32. imageUrl: 'img/undraw_docusaurus_react.svg',
  33. description: (
  34. <>
  35. Complexity, size and other.
  36. </>
  37. ),
  38. },
  39. {
  40. title: <>Multiple languages</>,
  41. imageUrl: 'img/undraw_docusaurus_tree.svg',
  42. description: (
  43. <>
  44. C/C++, C# and Java.
  45. Recognises classes, interfaces, namespaces, functions, comments, preprocessor and much more.
  46. </>
  47. ),
  48. },
  49. {
  50. title: <>High performance and scalability</>,
  51. imageUrl: 'img/undraw_docusaurus_react.svg',
  52. description: (
  53. <>
  54. Applicable to huge code bases: thousands of files per minute.
  55. Ultra-fast feedback on iterative re-run.
  56. </>
  57. ),
  58. },
  59. {
  60. title: <>Effortless application to legacy code</>,
  61. imageUrl: 'img/undraw_docusaurus_react.svg',
  62. description: (
  63. <>
  64. Recognises legacy, modified and new code.
  65. Prevents from negative trends. Encourages positive.
  66. </>
  67. ),
  68. },
  69. ];
  70. function Feature({imageUrl, title, description}) {
  71. const imgUrl = useBaseUrl(imageUrl);
  72. return (
  73. <div className={clsx('col col--4', styles.feature)}>
  74. {imgUrl && (
  75. <div className="text--center">
  76. <img className={styles.featureImage} src={imgUrl} alt={title} />
  77. </div>
  78. )}
  79. <h3>{title}</h3>
  80. <p>{description}</p>
  81. </div>
  82. );
  83. }
  84. function Home() {
  85. const context = useDocusaurusContext();
  86. const {siteConfig = {}} = context;
  87. return (
  88. <Layout
  89. title={`${siteConfig.title}`}
  90. description="Description will go into a meta tag in <head />">
  91. <header className={clsx('hero hero--primary', styles.heroBanner)}>
  92. <div className="container">
  93. <h1 className="hero__title">{siteConfig.title}</h1>
  94. <p className="hero__subtitle">{siteConfig.tagline}</p>
  95. <div className={styles.buttons}>
  96. <Link
  97. className={clsx(
  98. 'button button--outline button--secondary button--lg',
  99. styles.getStarted,
  100. )}
  101. to={useBaseUrl('docs/01-overview')}>
  102. Get Started
  103. </Link>
  104. </div>
  105. </div>
  106. </header>
  107. <main>
  108. {features && features.length > 0 && (
  109. <section className={styles.features}>
  110. <div className="container">
  111. <div className="row">
  112. {features.map((props, idx) => (
  113. <Feature key={idx} {...props} />
  114. ))}
  115. </div>
  116. </div>
  117. </section>
  118. )}
  119. </main>
  120. </Layout>
  121. );
  122. }
  123. export default Home;